winex11: Keep track of the window colormap and free it on destroy.
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 2fc8660..2d93104 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -360,12 +360,13 @@
{
XSetWindowAttributes attrib;
+ data->colormap = XCreateColormap(display, parent, vis->visual,
+ (vis->class == PseudoColor ||
+ vis->class == GrayScale ||
+ vis->class == DirectColor) ?
+ AllocAll : AllocNone);
attrib.override_redirect = True;
- attrib.colormap = XCreateColormap(display, parent, vis->visual,
- (vis->class == PseudoColor ||
- vis->class == GrayScale ||
- vis->class == DirectColor) ?
- AllocAll : AllocNone);
+ attrib.colormap = data->colormap;
XInstallColormap(gdi_display, attrib.colormap);
data->gl_drawable = XCreateWindow(display, parent, -w, 0, w, h, 0,
@@ -1294,6 +1295,13 @@
destroy_whole_window( display, data );
destroy_icon_window( display, data );
+ if (data->colormap)
+ {
+ wine_tsx11_lock();
+ XFreeColormap( display, data->colormap );
+ wine_tsx11_unlock();
+ }
+
if (thread_data->last_focus == hwnd) thread_data->last_focus = 0;
if (data->hWMIconBitmap) DeleteObject( data->hWMIconBitmap );
if (data->hWMIconMask) DeleteObject( data->hWMIconMask);