Re: gtk_set_image_from_pixbuf mem leak



On Thu, May 01, 2003 at 02:51:37PM -0700, Zigus Software Inc wrote:
> 
> I'm writing a game with Gtk v2.0. For the gameplay I
> have a table of 3 layers of pictures I have to update
> once in a while. If I use
> gtk_image_set_image_from_pixbuf(Pixbuf*) gtk doesn't
> seem to take care of deallocating the memory allocated
> by the old pixbuf. Is there any way I can do that
> myself?
> 

gtk_image_set_image_from_pixbuf() increments the pixbuf's reference
count. You will also own a reference yourself, which needs to be
decremented when you are no longer keeping a pointer to the pixbuf.

Havoc




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