summaryrefslogtreecommitdiff
path: root/gtk/gtkiconcache.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-06-19 09:32:38 +0200
committerAlexander Larsson <alexl@redhat.com>2013-06-19 09:40:19 +0200
commit280d606cd41c5d607e56d48e57bcba5b654cfa2e (patch)
treed399f131e25559585acf88421015ed940011b99f /gtk/gtkiconcache.c
parent3be5aefa3f12285ff1e276a8916d9620bda2981b (diff)
downloadgtk+-280d606cd41c5d607e56d48e57bcba5b654cfa2e.tar.gz
IconCache: Keep a ref on the GtkIconData
The icon data in GttkIconInfo->data is currently owned by the IconThemeDir->icon_data hashtable. However, on e.g. a theme change blow_themes() destroys the dirs and thus the data, meaning any outstanding GtkIconInfo points to stale data. We solve this by adding a refcount to GtkIconData and reffing it from GtkIconInfo. https://bugzilla.gnome.org/show_bug.cgi?id=702598
Diffstat (limited to 'gtk/gtkiconcache.c')
-rw-r--r--gtk/gtkiconcache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gtk/gtkiconcache.c b/gtk/gtkiconcache.c
index 7d8b3fc739..09aaa1b44e 100644
--- a/gtk/gtkiconcache.c
+++ b/gtk/gtkiconcache.c
@@ -520,6 +520,7 @@ _gtk_icon_cache_get_icon_data (GtkIconCache *cache,
return NULL;
data = g_slice_new0 (GtkIconData);
+ data->ref = 1;
offset = GET_UINT32 (cache->buffer, meta_data_offset);
if (offset)