Re: GtkImage/GdkPixbuf memory management



Hi,

"Kristof Vanbecelaere" <kristof vanbecelaere sonycom com> writes:

> I want to implement some operation on a GtkImage by creating a new GdkPixbuf
> and then calling gtk_image_set_from_pixbuf().
> 
> Is this the recommended way to implement such modifications? What about
> memory management? Should I somehow free/unref the old pixbuf? And what
> about the new pixbuf, should it be unref'ed after setting it to the image?

GtkImage unrefs the previously set GdkPixbuf for you. It also refs the new
one. So you should unref a pixbuf after setting it.


Salut, Sven



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