glx: Only remove drawables from the hash when we actually delete them
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 29 Sep 2010 12:32:12 +0000 (08:32 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 29 Sep 2010 12:32:29 +0000 (08:32 -0400)
https://bugs.freedesktop.org/show_bug.cgi?id=30457

src/glx/dri_common.c

index 5fb5255416b48dabae8ac6382f248ed6908bc3d6..83d6e3c31082ca22420e58468be3535ce268bb66 100644 (file)
@@ -391,17 +391,19 @@ driReleaseDrawables(struct glx_context *gc)
 
    if (__glxHashLookup(priv->drawHash,
                       gc->currentDrawable, (void *) &pdraw) == 0) {
-      if (pdraw->drawable == pdraw->xDrawable)
+      if (pdraw->drawable == pdraw->xDrawable) {
         (*pdraw->destroyDrawable)(pdraw);
-      __glxHashDelete(priv->drawHash, gc->currentDrawable);
+        __glxHashDelete(priv->drawHash, gc->currentDrawable);
+      }
    }
 
    if (gc->currentDrawable != gc->currentReadable &&
        __glxHashLookup(priv->drawHash,
                       gc->currentReadable, (void *) &pdraw) == 0) {
-      if (pdraw->drawable == pdraw->xDrawable)
+      if (pdraw->drawable == pdraw->xDrawable) {
         (*pdraw->destroyDrawable)(pdraw);
-      __glxHashDelete(priv->drawHash, gc->currentReadable);
+        __glxHashDelete(priv->drawHash, gc->currentReadable);
+      }
    }
 }