]> Dogcows Code - chaz/openbox/commitdiff
free the colors on shutdown
authorDana Jansens <danakj@orodu.net>
Thu, 13 Feb 2003 05:07:25 +0000 (05:07 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 13 Feb 2003 05:07:25 +0000 (05:07 +0000)
otk/pseudorendercontrol.cc

index 4e2691a2198f85ac5ad485e3d09b068a9c3eb069..2b878200e7f034e38edd90e7b00658ad221fa1a1 100644 (file)
@@ -101,7 +101,12 @@ PseudoRenderControl::~PseudoRenderControl()
 {
   printf("Destroying PseudoColor RenderControl\n");
 
-  delete _colors;
+  unsigned long *pixels = new unsigned long [ncolors], *p = pixels;
+  for (int i = 0; i < _ncolors; ++i, ++p)
+    *p = _colors[i].pixel;
+  XFreeColors(**display, display->screenInfo(_screen)->colormap(), pixels,
+              _ncolors, 0);
+  delete [] colors;
 }
 
 void PseudoRenderControl::reduceDepth(Surface &sf, XImage *im) const
This page took 0.022893 seconds and 4 git commands to generate.