commit 5bb1295d0c13d661b4663df9be26a272d478927d (HEAD, master)
Author: Cosimo Cecchi <cosimoc@gnome.org>
Date:   Mon Mar 24 16:36:21 2014 -0700

    icontheme: fix emblemed icons fallout
    
    Commit faba7df4fea6cd09470b3b2cc277c35e6cf7c380 changed the logic in
    apply_emblems() so that GtkIconInfo->emblems_applied would be set to
    TRUE even in case there was no emblem info available, which confuses the
    theme cache.
    This commit changes the logic back, so that NULL is returned from
    apply_emblems_to_pixbuf() when there are no emblems available, fixing
    the bug.

diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 0eb44bd..606eb01 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3578,7 +3578,7 @@ apply_emblems_to_pixbuf (GdkPixbuf *pixbuf,
   GSList *l;
 
   if (info->emblem_infos == NULL)
-    return g_object_ref (pixbuf);
+    return NULL;
 
   w = gdk_pixbuf_get_width (pixbuf);
   h = gdk_pixbuf_get_height (pixbuf);
@@ -3658,9 +3658,8 @@ apply_emblems (GtkIconInfo *info)
     {
       g_object_unref (info->pixbuf);
       info->pixbuf = icon;
+      info->emblems_applied = TRUE;
     }
-
-  info->emblems_applied = TRUE;
 }
 
 /* If this returns TRUE, its safe to call
@@ -4305,8 +4304,11 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo  *icon_info,
       GdkPixbuf *icon;
 
       icon = apply_emblems_to_pixbuf (pixbuf, icon_info);
-      g_object_unref (pixbuf);
-      pixbuf = icon;
+      if (icon != NULL)
+        {
+          g_object_unref (pixbuf);
+          pixbuf = icon;
+        }
 
       if (use_cache)
 	{

