From: Dana Jansens Date: Thu, 13 Feb 2003 04:54:54 +0000 (+0000) Subject: no segfault plz tnx X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=68482ff556b5b8b48bb536a4a95c5a1de01895cb;p=chaz%2Fopenbox no segfault plz tnx --- diff --git a/otk/rendercolor.cc b/otk/rendercolor.cc index 6143a451..3e20be1a 100644 --- a/otk/rendercolor.cc +++ b/otk/rendercolor.cc @@ -102,9 +102,10 @@ RenderColor::~RenderColor() { unsigned long color = _blue | _green << 8 | _red << 16; - CacheItem *item = _cache[_screen][color]; + if (_allocated) { + CacheItem *item = _cache[_screen][color]; + assert(item); // better be... - if (item) { if (--item->count <= 0) { // remove from the cache XFreeGC(**display, _gc);