From b050687720c4d0ba526956c90ee473b0c9ef8495 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 17 Aug 2009 19:30:41 +0000 Subject: [PATCH] oops, need to XFreeColor. --- direct/src/plugin/p3dX11SplashWindow.cxx | 5 +++++ direct/src/plugin/p3dX11SplashWindow.h | 1 + 2 files changed, 6 insertions(+) diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index dadc7ca5d0..298c0e9b16 100755 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -638,6 +638,7 @@ setup_gc() { Colormap colormap = DefaultColormap(_display, _screen); if (XAllocColor(_display, colormap, &blue)) { + _blue_pixel = blue.pixel; gcval.foreground = blue.pixel; } @@ -667,6 +668,10 @@ close_window() { XFreeGC(_display, _bar_context); } _bar_context = None; + + // Also free the color we allocated. + Colormap colormap = DefaultColormap(_display, _screen); + XFreeColors(_display, colormap, &_blue_pixel, 1, 0); } if (_graphics_context != None) { diff --git a/direct/src/plugin/p3dX11SplashWindow.h b/direct/src/plugin/p3dX11SplashWindow.h index 7bc7b993b1..93a4b0979e 100755 --- a/direct/src/plugin/p3dX11SplashWindow.h +++ b/direct/src/plugin/p3dX11SplashWindow.h @@ -81,6 +81,7 @@ private: int _screen; GC _graphics_context; GC _bar_context; + unsigned long _blue_pixel; XImage* _image; XImage* _resized_image; int _image_width, _image_height;