(trunk gtk) #2605: GIcon memory leak in GTK+ client

This commit is contained in:
Charles Kerr 2009-11-25 04:42:42 +00:00
parent 3799fa2ec7
commit baf0ffb02c
1 changed files with 3 additions and 0 deletions

View 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;
}