[gimp/soc-2011-seamless-clone2] app: fix re-initializing fontconfig in gimp_fonts_reset()



commit d797c8fa4e64d165f6fc919b59204d64fa602ed8
Author: Nils Philippsen <nils redhat com>
Date:   Tue Feb 5 13:54:36 2013 +0100

    app: fix re-initializing fontconfig in gimp_fonts_reset()
    
    Calling FcConfigSetCurrent() with NULL is just broken, it almost
    immediately dereferences the passed pointer. Apparently this line
    is executed seldom, otherwise we'd see way more crashes in this place.
    Just use FcInitReinitialize() which exists for the very purpose of
    reinitializing the fontconfig library.

 app/text/gimp-fonts.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/app/text/gimp-fonts.c b/app/text/gimp-fonts.c
index a38d754..ced8ef8 100644
--- a/app/text/gimp-fonts.c
+++ b/app/text/gimp-fonts.c
@@ -116,10 +116,8 @@ gimp_fonts_reset (Gimp *gimp)
   if (gimp->no_fonts)
     return;
 
-  /* We clear the default config here, so any subsequent fontconfig use will
-   * reinit the library with defaults. (Maybe we should call FcFini here too?)
-   */
-  FcConfigSetCurrent (NULL);
+  /* Reinit the library with defaults. */
+  FcInitReinitialize ();
 }
 
 static gboolean


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