Commit 41af639d authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Don't leak icon

2008-01-22  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-bookmark.c:
        (nautilus_bookmark_get_pixbuf):
	Don't leak icon
	
        * libnautilus-private/nautilus-cell-renderer-pixbuf-emblem.c:
	Indentation fixups
	
        * libnautilus-private/nautilus-icon-info.c:
        (nautilus_icon_info_get_pixbuf_nodefault):
	Only set toggle ref first time we get a pixbuf request.


svn path=/trunk/; revision=13638
parent 12f3e114
2008-01-22 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-bookmark.c:
(nautilus_bookmark_get_pixbuf):
Don't leak icon
* libnautilus-private/nautilus-cell-renderer-pixbuf-emblem.c:
Indentation fixups
* libnautilus-private/nautilus-icon-info.c:
(nautilus_icon_info_get_pixbuf_nodefault):
Only set toggle ref first time we get a pixbuf request.
2008-01-22 Alexander Larsson <alexl@redhat.com>
* src/nautilus-main.c:
......
......@@ -240,6 +240,8 @@ nautilus_bookmark_get_pixbuf (NautilusBookmark *bookmark,
info = nautilus_icon_info_lookup (icon, pixel_size);
result = nautilus_icon_info_get_pixbuf_at_size (info, pixel_size);
g_object_unref (info);
g_object_unref (icon);
return result;
}
......
......@@ -263,9 +263,9 @@ nautilus_cell_renderer_pixbuf_emblem_get_property (GObject *object,
static void
nautilus_cell_renderer_pixbuf_emblem_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
GdkPixbuf *pixbuf;
NautilusCellRendererPixbufEmblem *cellpixbuf = NAUTILUS_CELL_RENDERER_PIXBUF_EMBLEM (object);
......@@ -343,7 +343,7 @@ nautilus_cell_renderer_pixbuf_emblem_new (void)
static void
nautilus_cell_renderer_pixbuf_emblem_create_stock_pixbuf (NautilusCellRendererPixbufEmblem *cellpixbuf,
GtkWidget *widget)
GtkWidget *widget)
{
NautilusCellRendererPixbufEmblemInfo *cellinfo = g_object_get_data (G_OBJECT (cellpixbuf), CELLINFO_KEY);
......
......@@ -437,11 +437,13 @@ nautilus_icon_info_get_pixbuf_nodefault (NautilusIconInfo *icon)
res = NULL;
} else {
res = g_object_ref (icon->pixbuf);
icon->sole_owner = FALSE;
g_object_add_toggle_ref (G_OBJECT (res),
pixbuf_toggle_notify,
icon);
if (icon->sole_owner) {
icon->sole_owner = FALSE;
g_object_add_toggle_ref (G_OBJECT (res),
pixbuf_toggle_notify,
icon);
}
}
return res;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment