]> Dogcows Code - chaz/openbox/commitdiff
no segfault plz tnx
authorDana Jansens <danakj@orodu.net>
Thu, 13 Feb 2003 04:54:54 +0000 (04:54 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 13 Feb 2003 04:54:54 +0000 (04:54 +0000)
otk/rendercolor.cc

index 6143a4510b4bec6d807e923f1a0e7ea7c2a4af96..3e20be1a06a56972f376563722025b42a50f3cc2 100644 (file)
@@ -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);
This page took 0.022507 seconds and 4 git commands to generate.