]> git.0d.be Git - empathy.git/commitdiff
theme-manager: don't leak info is 2 themes have the same name
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 2 Jul 2012 12:08:01 +0000 (14:08 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 2 Jul 2012 12:11:23 +0000 (14:11 +0200)
libempathy-gtk/empathy-theme-manager.c

index 4c8176b8878febd10014cad9829baa28714f278f..47ea737ffcfeafa73abf4db824d06b8d782cbf1f 100644 (file)
@@ -336,7 +336,8 @@ empathy_theme_manager_get_adium_themes (void)
   gint i = 0;
   const gchar *dir;
 
-  hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+  hash = g_hash_table_new_full (g_str_hash, g_str_equal,
+      g_free, (GDestroyNotify) g_hash_table_unref);
 
   /* Start from the more general locations (the system) to the more specific
    * ones ($HOME, EMPATHY_SRCDIR) so the more specific themes will override
@@ -371,7 +372,8 @@ empathy_theme_manager_get_adium_themes (void)
     }
 
   /* Pass ownership of the info hash table to the list */
-  result = g_list_copy (g_hash_table_get_values (hash));
+  result = g_list_copy_deep (g_hash_table_get_values (hash),
+      (GCopyFunc) g_hash_table_ref, NULL);
 
   g_hash_table_unref (hash);