Re: Need to unref pixmap and mask after gtk_pixmap_new()?



learfox furry ao net writes:
Do I need to gdk_pixmap_unref() and gdk_bitmap_unref() the pixmap and mask
after calling gtk_pixmap_new()?


Yes.
 
Also, do I need to unref after I destroy the pixmap widget returned by
gtk_pixmap_new()?


gtk_pixmap_new () does not pass you a reference; the new object has a
"floating" reference. To own a reference, you must call 
 gtk_object_ref (widget);
 gtk_object_sink (widget);

Normally the first container you pass the widget to will do
this. After sinking the widget, the floating reference will be
gone. No one can own the floating reference but anyone can remove it.

If you never hand the pixmap widget to an owner, that is you never put
it in a container, to get rid of it just do gtk_object_sink(widget)
which will strip the floating reference.

Havoc




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