Index: gtk/gtkrc.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrc.c,v
retrieving revision 1.178
diff -u -p -r1.178 gtkrc.c
--- gtk/gtkrc.c	19 Jun 2006 23:53:28 -0000	1.178
+++ gtk/gtkrc.c	5 Jul 2006 16:45:12 -0000
@@ -1292,8 +1292,11 @@ static void
 gtk_rc_style_real_merge (GtkRcStyle *dest,
 			 GtkRcStyle *src)
 {
-  gint i;
-  
+  GtkRcStylePrivate *dest_priv = GTK_RC_STYLE_GET_PRIVATE (dest);
+  GtkRcStylePrivate *src_priv  = GTK_RC_STYLE_GET_PRIVATE (src);
+  GSList            *concat_list;
+  gint               i;
+
   for (i = 0; i < 5; i++)
     {
       if (!dest->bg_pixmap_name[i] && src->bg_pixmap_name[i])
@@ -1347,6 +1350,16 @@ gtk_rc_style_real_merge (GtkRcStyle *des
 			    &g_array_index (src->rc_properties, GtkRcProperty, i),
 			    FALSE);
     }
+
+  concat_list = g_slist_copy (src->icon_factories);
+  g_slist_foreach (concat_list, (GFunc) g_object_ref, NULL);
+  dest->icon_factories = g_slist_concat (dest->icon_factories,
+                                         concat_list);
+
+  concat_list = g_slist_copy (src_priv->color_hashes);
+  g_slist_foreach (concat_list, (GFunc) g_hash_table_ref, NULL);
+  dest_priv->color_hashes = g_slist_concat (dest_priv->color_hashes,
+                                            concat_list);
 }
 
 static GtkStyle *
@@ -2211,7 +2224,6 @@ gtk_rc_init_style (GtkRcContext *context
     {
       GtkRcStyle *base_style = NULL;
       GtkRcStyle *proto_style;
-      GtkRcStylePrivate *proto_priv;
       GtkRcStyleClass *proto_style_class;
       GSList *tmp_styles;
       GType rc_style_type = GTK_TYPE_RC_STYLE;
@@ -2239,30 +2251,17 @@ gtk_rc_init_style (GtkRcContext *context
       
       proto_style_class = GTK_RC_STYLE_GET_CLASS (base_style);
       proto_style = proto_style_class->create_rc_style (base_style);
-      proto_priv = GTK_RC_STYLE_GET_PRIVATE (proto_style);
 
       tmp_styles = rc_styles;
       while (tmp_styles)
 	{
 	  GtkRcStyle *rc_style = tmp_styles->data;
-          GtkRcStylePrivate *rc_priv = GTK_RC_STYLE_GET_PRIVATE (rc_style);
-          GSList *concat_list;
-          
+
 	  proto_style_class->merge (proto_style, rc_style);	  
           
 	  /* Point from each rc_style to the list of styles */
 	  if (!g_slist_find (rc_style->rc_style_lists, rc_styles))
 	    rc_style->rc_style_lists = g_slist_prepend (rc_style->rc_style_lists, rc_styles);
-
-          concat_list = g_slist_copy (rc_style->icon_factories);
-          g_slist_foreach (concat_list, (GFunc) g_object_ref, NULL);
-          proto_style->icon_factories = g_slist_concat (proto_style->icon_factories,
-                                                        concat_list);
-
-          concat_list = g_slist_copy (rc_priv->color_hashes);
-          g_slist_foreach (concat_list, (GFunc) g_hash_table_ref, NULL);
-          proto_priv->color_hashes = g_slist_concat (proto_priv->color_hashes,
-                                                     concat_list);
 
 	  tmp_styles = tmp_styles->next;
 	}
