[gimp/gimp-2-8] app: fix re-initializing fontconfig in gimp_fonts_reset()



commit bd6c3468aa95e871e66384b217e546316d5c89e2
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.
    (cherry picked from commit 1c00c2e4f831a16dbba15e605dc19151a3a0246c)

 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]