Clarification on when to unref pixbufs -GtkIconView
- From: Paul Stuart <Paul_Stuart seektech com>
- To: "gtk-list gnome org" <gtk-list gnome org>
- Subject: Clarification on when to unref pixbufs -GtkIconView
- Date: Tue, 18 May 2010 07:49:20 -0700
Hi,
I am loading a pixbuf from a file, scaling it and then sticking it into a GtkIconView. A snippet of code:
.
.
.
.
newPixBuf = gdk_pixbuf_new_from_file ("myImage.png", &err);
scaledPixBuf = gdk_pixbuf_scale_simple(newPixBuf, ICON_VIEW_W, ICON_VIEW_H, GDK_INTERP_BILINEAR);
if(NULL == err) { // no error
gtk_list_store_append (store, &iter);
gtk_list_store_set(store, &iter, COL_PIXBUF0, scaledPixBuf, -1);
g_object_unref(scaledPixBuf);
g_object_unref(newPixBuf);
.
.
.
.
Am I correct in calling the g_object_unref after loading it into the list_store?
Sample code I've seen here and there online doesn't unref the pixbufs, but the documentation seems to indicate one should.
Thanks!
Paul
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]