diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-07-02 17:16:54 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-07-02 17:16:54 +0000 |
commit | fe7fb8c62fefd2dd822e950c69fdd194a9370951 (patch) | |
tree | 1a163d1b4c1ffbde566f354db588c2f9306982ae /gdk/x11/gdkpixmap-x11.c | |
parent | 4f1ccca5940937ca184c331e035c71ef84675193 (diff) | |
download | gtk+-fe7fb8c62fefd2dd822e950c69fdd194a9370951.tar.gz |
Add a is_foreign flag to the structure. Do not call XFreePixmap on pixmaps
Sun Jul 2 13:06:26 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkpixmap-x11.[ch] Changes-1.4.txt: Add a is_foreign
flag to the structure. Do not call XFreePixmap on pixmaps created
by gdk_pixmap_foreign_new().
Diffstat (limited to 'gdk/x11/gdkpixmap-x11.c')
-rw-r--r-- | gdk/x11/gdkpixmap-x11.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c index 9bef142f30..618c21fa5d 100644 --- a/gdk/x11/gdkpixmap-x11.c +++ b/gdk/x11/gdkpixmap-x11.c @@ -120,8 +120,10 @@ gdk_pixmap_impl_x11_finalize (GObject *object) { GdkPixmapImplX11 *impl = GDK_PIXMAP_IMPL_X11 (object); GdkPixmap *wrapper = GDK_PIXMAP (GDK_DRAWABLE_IMPL_X11 (impl)->wrapper); + + if (!impl->is_foreign) + XFreePixmap (GDK_PIXMAP_XDISPLAY (wrapper), GDK_PIXMAP_XID (wrapper)); - XFreePixmap (GDK_PIXMAP_XDISPLAY (wrapper), GDK_PIXMAP_XID (wrapper)); gdk_xid_table_remove (GDK_PIXMAP_XID (wrapper)); G_OBJECT_CLASS (parent_class)->finalize (object); @@ -171,10 +173,11 @@ gdk_pixmap_new (GdkWindow *window, GDK_WINDOW_XID (window), width, height, depth); + pix_impl->is_foreign = FALSE; pix_impl->width = width; pix_impl->height = height; GDK_PIXMAP_OBJECT (pixmap)->depth = depth; - + gdk_xid_table_insert (&GDK_PIXMAP_XID (pixmap), pixmap); return pixmap; @@ -205,6 +208,7 @@ gdk_bitmap_create_from_data (GdkWindow *window, pix_impl = GDK_PIXMAP_IMPL_X11 (GDK_PIXMAP_OBJECT (pixmap)->impl); draw_impl->wrapper = GDK_DRAWABLE (pixmap); + pix_impl->is_foreign = FALSE; pix_impl->width = width; pix_impl->height = height; GDK_PIXMAP_OBJECT (pixmap)->depth = 1; @@ -253,6 +257,7 @@ gdk_pixmap_create_from_data (GdkWindow *window, pix_impl = GDK_PIXMAP_IMPL_X11 (GDK_PIXMAP_OBJECT (pixmap)->impl); draw_impl->wrapper = GDK_DRAWABLE (pixmap); + pix_impl->is_foreign = FALSE; pix_impl->width = width; pix_impl->height = height; GDK_PIXMAP_OBJECT (pixmap)->depth = depth; @@ -301,6 +306,7 @@ gdk_pixmap_foreign_new (GdkNativeWindow anid) draw_impl->xdisplay = GDK_DISPLAY (); draw_impl->xid = xpixmap; + pix_impl->is_foreign = TRUE; pix_impl->width = w_ret; pix_impl->height = h_ret; GDK_PIXMAP_OBJECT (pixmap)->depth = depth_ret; |