glib r7616 - in trunk: . gio
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r7616 - in trunk: . gio
- Date: Mon, 20 Oct 2008 16:49:16 +0000 (UTC)
Author: chpe
Date: Mon Oct 20 16:49:16 2008
New Revision: 7616
URL: http://svn.gnome.org/viewvc/glib?rev=7616&view=rev
Log:
Bug 557087 â mem leak in g_content_types_get_registered
Modified:
trunk/ChangeLog
trunk/gio/gcontenttype.c
Modified: trunk/gio/gcontenttype.c
==============================================================================
--- trunk/gio/gcontenttype.c (original)
+++ trunk/gio/gcontenttype.c Mon Oct 20 16:49:16 2008
@@ -998,7 +998,7 @@
if (g_str_has_suffix (ent->d_name, ".xml"))
{
mimetype = g_strdup_printf ("%s/%.*s", prefix, (int) strlen (ent->d_name) - 4, ent->d_name);
- g_hash_table_insert (mimetypes, mimetype, NULL);
+ g_hash_table_replace (mimetypes, mimetype, NULL);
}
}
closedir (d);
@@ -1053,7 +1053,7 @@
int i;
GList *l;
- mimetypes = g_hash_table_new (g_str_hash, g_str_equal);
+ mimetypes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
enumerate_mimetypes_dir (g_get_user_data_dir (), mimetypes);
dirs = g_get_system_data_dirs ();
@@ -1064,7 +1064,10 @@
l = NULL;
g_hash_table_iter_init (&iter, mimetypes);
while (g_hash_table_iter_next (&iter, &key, NULL))
- l = g_list_prepend (l, key);
+ {
+ l = g_list_prepend (l, key);
+ g_hash_table_iter_steal (&iter);
+ }
g_hash_table_destroy (mimetypes);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]