[PATCH 4/4] glx: Simplify glXDestroyContext

Adam Jackson ajax at redhat.com
Wed Oct 2 14:51:26 PDT 2013


We can just free the resource unconditionally here.  ContextGone (which
FreeResourceByType will call) already does:

    cx->idExists = GL_FALSE;
    if (!cx->currentClient) {
        __glXFreeContext(cx);
    }

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glx/glxcmds.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 288b417..bfebf93 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -397,9 +397,7 @@ __glXDisp_DestroyContext(__GLXclientState * cl, GLbyte * pc)
                          &glxc, &err))
         return err;
 
-    glxc->idExists = GL_FALSE;
-    if (!glxc->currentClient)
-        FreeResourceByType(req->context, __glXContextRes, FALSE);
+    FreeResourceByType(req->context, __glXContextRes, FALSE);
 
     return Success;
 }
-- 
1.8.3.1



More information about the xorg-devel mailing list