glx: Destroy pixmap after destroying glx and dri drawables
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 9 Sep 2010 00:55:02 +0000 (20:55 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 9 Sep 2010 00:55:24 +0000 (20:55 -0400)
Now that we suppress BadDrawable from DRI2DestroyDrawable, this doesn't
matter, but we would get that error before when destroying pbuffers.

src/glx/glx_pbuffer.c

index d065f4bb6c02609014b86094e49507d741e1f70a..d1cb66b87cac825d6fa0f3b8b40775f8c6aebb83 100644 (file)
@@ -222,10 +222,10 @@ DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable)
    __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
 
    if (pdraw != NULL) {
-      if (destroy_xdrawable)
-         XFreePixmap(pdraw->psc->dpy, pdraw->xDrawable);
       (*pdraw->destroyDrawable) (pdraw);
       __glxHashDelete(priv->drawHash, drawable);
+      if (destroy_xdrawable)
+         XFreePixmap(pdraw->psc->dpy, pdraw->xDrawable);
    }
 }