OSDN Git Service

egl_glx: fix eglDestroyContext
authorChia-I Wu <olv@lunarg.com>
Sat, 3 Dec 2011 03:04:34 +0000 (11:04 +0800)
committerChia-I Wu <olv@lunarg.com>
Sat, 3 Dec 2011 03:10:16 +0000 (11:10 +0800)
Wrong pointers are passed to glXDestroyContext.

Spotted by Brian Paul.

src/egl/drivers/glx/egl_glx.c

index bdc8a28..e07ce90 100644 (file)
@@ -720,11 +720,12 @@ static EGLBoolean
 GLX_eglDestroyContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
 {
    struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
+   struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
    struct GLX_egl_context *GLX_ctx = GLX_egl_context(ctx);
 
    if (_eglPutContext(ctx)) {
       assert(GLX_ctx);
-      GLX_drv->glXDestroyContext(disp, ctx);
+      GLX_drv->glXDestroyContext(GLX_dpy->dpy, GLX_ctx->context);
 
       free(GLX_ctx);
    }