Don't call XFreeColormap on foreign colormaps

svn path=/trunk/; revision=19969
This commit is contained in:
Matthias Clasen 2008-04-03 05:08:05 +00:00
parent 5fb4e96b5d
commit 1d119938c7
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2008-04-02 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkcolor-x11.c: Don't call XFreeColormap on foreign
colormaps. Found by Daniel Berrange.
2008-04-02 Björn Lindqvist <bjourne@gmail.com>
* tests/autotestfilechooser.c: Cover

View File

@ -46,7 +46,7 @@ struct _GdkColormapPrivateX11
GdkColorInfo *info;
time_t last_sync_time;
guint foreign : 1;
gboolean foreign;
};
#define GDK_COLORMAP_PRIVATE_DATA(cmap) ((GdkColormapPrivateX11 *) GDK_COLORMAP (cmap)->windowing_data)
@ -107,7 +107,7 @@ gdk_colormap_finalize (GObject *object)
gdk_colormap_remove (colormap);
if (!private->screen->closed)
if (!private->screen->closed && !private->foreign)
XFreeColormap (GDK_SCREEN_XDISPLAY (private->screen), private->xcolormap);
if (private->hash)
@ -1292,6 +1292,7 @@ gdk_x11_colormap_foreign_new (GdkVisual *visual,
private->screen = screen;
private->xcolormap = xcolormap;
private->private_val = FALSE;
private->foreign = TRUE;
colormap->size = visual->colormap_size;