gmime r1436 - in trunk: . gmime



Author: fejj
Date: Sun Sep  7 17:03:26 2008
New Revision: 1436
URL: http://svn.gnome.org/viewvc/gmime?rev=1436&view=rev

Log:
2008-09-07  Jeffrey Stedfast  <fejj novell com>

	* gmime/gmime-charset.c (g_mime_charset_map_init): Create the
	iconv_charsets hashtable using g_hash_table_new_full() so that we
	don't have to call g_hash_table_foreach() before destroying it in
	g_mime_charset_map_shutdown().



Modified:
   trunk/ChangeLog
   trunk/gmime/gmime-charset.c

Modified: trunk/gmime/gmime-charset.c
==============================================================================
--- trunk/gmime/gmime-charset.c	(original)
+++ trunk/gmime/gmime-charset.c	Sun Sep  7 17:03:26 2008
@@ -174,14 +174,6 @@
 #endif /* G_THREADS_ENABLED */
 
 
-static void
-iconv_charset_free (gpointer key, gpointer value, gpointer user_data)
-{
-	g_free (key);
-	g_free (value);
-}
-
-
 /**
  * g_mime_charset_map_shutdown:
  *
@@ -193,7 +185,6 @@
 	if (!iconv_charsets)
 		return;
 	
-	g_hash_table_foreach (iconv_charsets, iconv_charset_free, NULL);
 	g_hash_table_destroy (iconv_charsets);
 	iconv_charsets = NULL;
 	
@@ -264,7 +255,7 @@
 	if (iconv_charsets)
 		return;
 	
-	iconv_charsets = g_hash_table_new (g_str_hash, g_str_equal);
+	iconv_charsets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
 	
 	for (i = 0; known_iconv_charsets[i].charset != NULL; i++) {
 		charset = g_ascii_strdown (known_iconv_charsets[i].charset, -1);



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