[pango: 1/2] use g_critical instead of g_error according to docs of pango_cairo_font_map_new() it shouldn't crash




commit 0512bbcf4aab1ff62aa9d8f41ec2ca88ef4cfe2a
Author: Naveen M K <naveen@syrusdark.website>
Date:   Tue Jan 19 18:11:06 2021 +0000

    use g_critical instead of g_error
    according to docs of pango_cairo_font_map_new() it shouldn't crash
    the application by calling g_error.
    Instead, it should return NULL and it can log that using g_critical.

 pango/pangocairo-fontmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pango/pangocairo-fontmap.c b/pango/pangocairo-fontmap.c
index 47c2245f..120ccb89 100644
--- a/pango/pangocairo-fontmap.c
+++ b/pango/pangocairo-fontmap.c
@@ -101,7 +101,7 @@ pango_cairo_font_map_new (void)
       " fontconfig"
 #endif
       ;
-    g_error ("Unknown $PANGOCAIRO_BACKEND value.\n  Available backends are:%s", backends);
+    g_critical ("Unknown $PANGOCAIRO_BACKEND value.\n  Available backends are:%s", backends);
   }
   return NULL;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]