evas: don't reinit fontconfig to destroy _fcConfig 45/110945/1
authorYoungbok Shin <youngb.shin@samsung.com>
Wed, 18 Jan 2017 09:35:08 +0000 (18:35 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Thu, 19 Jan 2017 01:47:18 +0000 (17:47 -0800)
FcInitReinitialize() function will destroy previous default(or current) _fcConfig.
If fontconfig is used outside of Evas, it can cause some crash issues.

@tizen_fix

Change-Id: Ied340277155832c802e5ce1f8f66a6c8be5ae115
(cherry picked from commit 0bc545d5555d30cfcb024ac52ad2e1f29457d3b7)

src/lib/evas/canvas/evas_font_dir.c

index 23b9cb4..9155c77 100644 (file)
@@ -1531,6 +1531,7 @@ evas_font_reinit(void)
    Eina_List *l;
    char *path;
 
+   /* TIZEN_ONLY(20170118): don't reinit fontconfig to destroy _fcConfig
    if (fc_config) FcConfigDestroy(fc_config);
 
    FcInitReinitialize();
@@ -1538,5 +1539,15 @@ evas_font_reinit(void)
 
    EINA_LIST_FOREACH(global_font_path, l, path)
       FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path);
+    */
+   if (fc_config)
+     {
+        FcConfigDestroy(fc_config);
+        fc_config = FcInitLoadConfigAndFonts();
+
+        EINA_LIST_FOREACH(global_font_path, l, path)
+           FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path);
+     }
+   /* END */
 #endif
 }