X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FGCCache.cc;h=35670a85046583142e93ae75c2508ef77e7e5bc6;hb=20bc088a998a362977233086577d74d00eea8765;hp=941d67ef0d0c80bd07005206b59000b904649d5c;hpb=8794d357e67abddf9fda9db77b235e294d0ec590;p=chaz%2Fopenbox diff --git a/src/GCCache.cc b/src/GCCache.cc index 941d67ef..35670a85 100644 --- a/src/GCCache.cc +++ b/src/GCCache.cc @@ -35,6 +35,12 @@ extern "C" { #include "Util.hh" +BGCCacheContext::~BGCCacheContext(void) { + if (gc) + XFreeGC(display->getXDisplay(), gc); +} + + void BGCCacheContext::set(const BColor &_color, const XFontStruct * const _font, const int _function, const int _subwindow) { @@ -90,8 +96,6 @@ BGCCache::~BGCCache(void) { std::for_each(cache, cache + cache_total_size, PointerAssassin()); delete [] cache; delete [] contexts; - cache = 0; - contexts = 0; } @@ -116,6 +120,7 @@ BGCCacheContext *BGCCache::nextContext(unsigned int scr) { fprintf(stderr, "BGCCache: context fault!\n"); abort(); + return (BGCCacheContext*) 0; // not reached }