From 8d55cc69e5f05a5230110b3c34f1acd812cfc235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 6 Apr 2010 17:24:20 -0400 Subject: [PATCH] glx: Destroy GLX drawables by the GLX XID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DestroyWindow hook only works when the GLX drawable XID is the same as the X window XID. This is only the case for drawables created through the pre-GLX-1.3 compatibility mechanism. GLX Drawables created using glXCreateWindow get a different XID and we need to look up the GLX private and pass the GLX XID to FreeResource instead. Signed-off-by: Kristian Høgsberg --- glx/glxscreens.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 58d8ee0..b3dad33 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -353,8 +353,11 @@ glxDestroyWindow(WindowPtr pWin) ScreenPtr pScreen = pWin->drawable.pScreen; __GLXscreen *pGlxScreen = glxGetScreen(pScreen); Bool retval = TRUE; + __GLXdrawable *drawable; - FreeResource(pWin->drawable.id, FALSE); + drawable = glxGetDrawableFromWindow(pWin); + if (drawable != NULL) + FreeResource(drawable->drawId, FALSE); /* call lower wrapped functions */ if (pGlxScreen->DestroyWindow) { -- 1.7.0.1