diff options
author | Brian Paul <[email protected]> | 2013-05-24 08:06:19 -0600 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-06-25 14:24:56 -0700 |
commit | 1b350311be19c8cd743600b4752f4341b3c7d8a5 (patch) | |
tree | 9f84f2e73bac08f9ecfd545e175889ac69c8c502 /src/mesa | |
parent | 5053bcbee62ea55546a38cf3c4264f7614087376 (diff) |
xlib: add null ctx check in glXDestroyContext()
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64934
NOTE: This is a candidate for the stable branches.
Reviewed-by: Jose Fonseca <[email protected]>
(cherry picked from commit fd9fe4470be0437c18cbd6d2bc8e568378f88200)
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/x11/fakeglx.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index c060711cac6..37b5e2f2b32 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1532,16 +1532,18 @@ void _kw_ungrab_all( Display *dpy ) static void Fake_glXDestroyContext( Display *dpy, GLXContext ctx ) { - struct fake_glx_context *glxCtx = (struct fake_glx_context *) ctx; - (void) dpy; - MakeCurrent_PrevContext = 0; - MakeCurrent_PrevDrawable = 0; - MakeCurrent_PrevReadable = 0; - MakeCurrent_PrevDrawBuffer = 0; - MakeCurrent_PrevReadBuffer = 0; - XMesaDestroyContext( glxCtx->xmesaContext ); - XMesaGarbageCollect(dpy); - free(glxCtx); + if (ctx) { + struct fake_glx_context *glxCtx = (struct fake_glx_context *) ctx; + (void) dpy; + MakeCurrent_PrevContext = 0; + MakeCurrent_PrevDrawable = 0; + MakeCurrent_PrevReadable = 0; + MakeCurrent_PrevDrawBuffer = 0; + MakeCurrent_PrevReadBuffer = 0; + XMesaDestroyContext( glxCtx->xmesaContext ); + XMesaGarbageCollect(dpy); + free(glxCtx); + } } |