Author: spouliot
Date: 2006-10-20 17:58:43 -0400 (Fri, 20 Oct 2006)
New Revision: 66845

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/font.c
Log:
2006-10-20  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * general.c: Don't delete the font cache hash table unless it was 
        created (which removes the glib runtime errors). This can occurs 
        when doing a C application using libgdiplus.



Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2006-10-20 21:05:08 UTC (rev 66844)
+++ trunk/libgdiplus/src/ChangeLog      2006-10-20 21:58:43 UTC (rev 66845)
@@ -1,3 +1,9 @@
+2006-10-20  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * general.c: Don't delete the font cache hash table unless it was 
+       created (which removes the glib runtime errors). This can occurs 
+       when doing a C application using libgdiplus.
+
 2006-10-18  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * graphics.c: In MeasureString check for bounding box height when 

Modified: trunk/libgdiplus/src/font.c
===================================================================
--- trunk/libgdiplus/src/font.c 2006-10-20 21:05:08 UTC (rev 66844)
+++ trunk/libgdiplus/src/font.c 2006-10-20 21:58:43 UTC (rev 66845)
@@ -319,7 +319,7 @@
 }
 
 static GStaticMutex patterns_mutex = G_STATIC_MUTEX_INIT;
-static GHashTable *patterns_hashtable;
+static GHashTable *patterns_hashtable = NULL;
 
 static GpStatus
 create_fontfamily_from_name (char* name, GpFontFamily **fontFamily)
@@ -371,8 +371,10 @@
 gdip_font_clear_pattern_cache (void)
 {
        g_static_mutex_lock (&patterns_mutex);
-       g_hash_table_foreach_remove (patterns_hashtable, free_cached_pattern, 
NULL);
-       g_hash_table_destroy (patterns_hashtable);
+       if (patterns_hashtable) {
+               g_hash_table_foreach_remove (patterns_hashtable, 
free_cached_pattern, NULL);
+               g_hash_table_destroy (patterns_hashtable);
+       }
        g_static_mutex_unlock (&patterns_mutex);
 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to