Re: gdk_pixmap_unref in perl-GTK?



On 02/11/01 Michael Ivanov wrote:
The pixmap is automatically unref()ed when it isn't used anymore, you
should not need to unref it explicitly from perl code.

    undef $pixmap;
Well, maybe I'm overcomplicating things.... But still: gdk_pixmap_unref
is mentioned in gtk-perl code the once: in bg_pixmap function, when
the background pixmap is changed. As I understand, to remove pixmap on
server side one has either to unref it explicitely via XFreePixmap() or
to disconnect from X-server. I create a pixmap with 'new Gtk::Gdk::Pixmap()'
which is mapped to gdk_pixmap_new(). XFreePixmap() is called only from
gdk_pixmap_unref() (at least in gtk+ 1.2.6). I didn't find a destructor for
gdk pixmap in .xs files and gdk_pixmap_unref() in perl-gtk is called only from
bg_pixmap.

DESTROY methods for boxed types are implemented in build/boxed.xsh.
But you where right, gkd_window_unref() was called on pixmaps instead
of gdk_pixmap_unref(). Fixed in cvs.

Should do the right thing when you are done with it (or just let perl do it
if it's a my var that goes out of scope...). If you think there is some
kind of memory leak, please post more details.
How one can check, which pixmaps exist in X server? Is there a utility to
list an X-server internal objects?

I don't think there is a way to do that.

Thanks,
        lupus

-- 
-----------------------------------------------------------------
lupus debian org                                     debian/rules
lupus ximian com                             Monkeys do it better




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