unref the thumbnail image after passing it to the callback. Callers will

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

svn path=/trunk/; revision=8661
This commit is contained in:
Jens Granseuer 2008-04-20 10:29:49 +00:00 committed by Jens Granseuer
parent ae6085786e
commit 10e93c23ad
5 changed files with 21 additions and 7 deletions

View file

@ -1,3 +1,11 @@
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
2008-04-19 Jens Granseuer <jensgr@gmx.net>
* Makefile.am:

View file

@ -633,8 +633,6 @@ update_thumbnail_in_treeview (const gchar *tv_name,
COL_THUMBNAIL, theme_thumbnail,
-1);
}
g_object_unref (theme_thumbnail);
}
static void

View file

@ -114,8 +114,6 @@ theme_thumbnail_update (GdkPixbuf *pixbuf,
g_free (path);
}
}
g_object_unref (pixbuf);
}
static GdkPixbuf *
@ -159,9 +157,10 @@ theme_thumbnail_generate (GnomeThemeMetaInfo *info, AppearanceData *data)
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);
}

View file

@ -1,3 +1,9 @@
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-19 Jens Granseuer <jensgr@gmx.net>
* gtkrc-utils.c: (gtkrc_get_details): accept NULL for the

View file

@ -842,12 +842,15 @@ message_from_child (GIOChannel *source,
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);