]> granicus.if.org Git - transmission/commitdiff
(trunk gtk) #2605: GIcon memory leak in GTK+ client
authorCharles Kerr <charles@transmissionbt.com>
Wed, 25 Nov 2009 04:42:42 +0000 (04:42 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Wed, 25 Nov 2009 04:42:42 +0000 (04:42 +0000)
gtk/icons.c

index e9edad47fc28ed5f43da3951b8a03835238bbb1e..b913c1123326408d46d346137cb9559f62102d24 100644 (file)
@@ -211,12 +211,15 @@ icon_cache_get_mime_type_icon( IconCache  * icon_cache,
     pixbuf = g_hash_table_lookup( icon_cache->cache, key );
     if (pixbuf != NULL) {
         g_object_ref( pixbuf );
+        g_object_unref( G_OBJECT( icon ) );
         return pixbuf;
     }
 
     pixbuf = _get_icon_pixbuf( icon, icon_cache->icon_size, icon_cache->icon_theme );
     if( pixbuf != NULL )
         g_hash_table_insert( icon_cache->cache, (gpointer) key, g_object_ref( pixbuf ) );
+
+    g_object_unref( G_OBJECT( icon ) );
        
     return pixbuf;
 }