Re: [gtk-list] Re: window icon
- From: Havoc Pennington <hp redhat com>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: window icon
- Date: 20 Apr 2000 18:49:23 -0400
Leonardo Zide <email@example.com> writes:
> The problem is that I'm not going to use the pixmap again, I just set
> the window icon and then I don't need it anymore. If I call:
> load_pixmap ("icon.xpm", window, &pixmap, &mask);
> gdk_window_set_icon (window->window, NULL, pixmap, mask);
> gdk_pixmap_unref (pixmap);
> gdk_pixmap_unref (mask);
> Then the icon is not set but if I remove the last 2 lines then
> everything works. When the window is destroyed, does it decrease the
> reference count of the GdkPixmap or should I do it myself ?
GDK definitely doesn't store a reference to the pixmap on the
GdkWindow, so you definitely have to unref() eventually if you want
the client-side memory freed.
I don't see any mention of when you can free the pixmap in the Xlib
book or man pages. If the window manager sets the pixmap as background
tile or something on a window, then you can definitely free it; but
who knows when/if that happens.
Owen will know. ;-)
] [Thread Prev