gnome-control-center r8661 - in trunk/capplets: appearance common



Author: jensg
Date: Sun Apr 20 10:29:49 2008
New Revision: 8661
URL: http://svn.gnome.org/viewvc/gnome-control-center?rev=8661&view=rev

Log:
2008-04-20  Jens Granseuer  <jensgr gmx net>

	* theme-thumbnail.c: (message_from_child): unref the thumbnail image
	after passing it to the callback. Callers will have to ref it if they
	want to keep it until after the callback has returned

2008-04-20  Jens Granseuer  <jensgr gmx net>

	* appearance-style.c: (update_thumbnail_in_treeview):
	* appearance-themes.c: (theme_thumbnail_update),
	(theme_thumbnail_generate): adapt to modified refcounting in the
	thumbnailer; thumbnails don't need to be unref'ed unless we explicitly
	retain a reference


Modified:
   trunk/capplets/appearance/ChangeLog
   trunk/capplets/appearance/appearance-style.c
   trunk/capplets/appearance/appearance-themes.c
   trunk/capplets/common/ChangeLog
   trunk/capplets/common/theme-thumbnail.c

Modified: trunk/capplets/appearance/appearance-style.c
==============================================================================
--- trunk/capplets/appearance/appearance-style.c	(original)
+++ trunk/capplets/appearance/appearance-style.c	Sun Apr 20 10:29:49 2008
@@ -633,8 +633,6 @@
           COL_THUMBNAIL, theme_thumbnail,
           -1);
   }
-
-  g_object_unref (theme_thumbnail);
 }
 
 static void

Modified: trunk/capplets/appearance/appearance-themes.c
==============================================================================
--- trunk/capplets/appearance/appearance-themes.c	(original)
+++ trunk/capplets/appearance/appearance-themes.c	Sun Apr 20 10:29:49 2008
@@ -114,8 +114,6 @@
       g_free (path);
     }
   }
-
-  g_object_unref (pixbuf);
 }
 
 static GdkPixbuf *
@@ -159,9 +157,10 @@
 
   thumb = theme_get_thumbnail_from_cache (info, data);
 
-  if (thumb != NULL)
+  if (thumb != NULL) {
     theme_thumbnail_update (thumb, info->name, data, FALSE);
-  else
+    g_object_unref (thumb);
+  } else
     generate_meta_theme_thumbnail_async (info,
         (ThemeThumbnailFunc) theme_thumbnail_done_cb, data, NULL);
 }

Modified: trunk/capplets/common/theme-thumbnail.c
==============================================================================
--- trunk/capplets/common/theme-thumbnail.c	(original)
+++ trunk/capplets/common/theme-thumbnail.c	Sun Apr 20 10:29:49 2008
@@ -842,12 +842,15 @@
             memcpy (pixels + rowstride * i, async_data.data->data + 4 * async_data.thumbnail_width * i, async_data.thumbnail_width * 4);
         }
 
-        /* callback function needs to unref the pixbuf */
+        /* callback function needs to ref the pixbuf if it wants to keep it */
         (* async_data.func) (pixbuf, async_data.theme_name, async_data.user_data);
 
         if (async_data.destroy)
           (* async_data.destroy) (async_data.user_data);
 
+        if (pixbuf)
+          g_object_unref (pixbuf);
+
         /* Clean up async_data */
         g_free (async_data.theme_name);
         g_source_remove (async_data.watch_id);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]