From 68482ff556b5b8b48bb536a4a95c5a1de01895cb Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 13 Feb 2003 04:54:54 +0000 Subject: [PATCH] no segfault plz tnx --- otk/rendercolor.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.45.2