summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-05-24 08:06:04 -0600
committerBrian Paul <[email protected]>2013-05-24 16:35:25 -0600
commitfd29e4acdae3a667e5b2519aa87ad457decb50c6 (patch)
tree236e251f93f6d3ba082f1d5c5480ceabc804c7ea /src/gallium/state_trackers
parentdb4580cbdf66c587867130cb7b2e630ea247971e (diff)
st/glx: 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]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/glx/xlib/glx_api.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index a66ebc8e8a4..c6dc134c5cf 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -1353,16 +1353,18 @@ glXQueryExtension( Display *dpy, int *errorBase, int *eventBase )
PUBLIC void
glXDestroyContext( Display *dpy, GLXContext ctx )
{
- GLXContext glxCtx = ctx;
- (void) dpy;
- MakeCurrent_PrevContext = 0;
- MakeCurrent_PrevDrawable = 0;
- MakeCurrent_PrevReadable = 0;
- MakeCurrent_PrevDrawBuffer = 0;
- MakeCurrent_PrevReadBuffer = 0;
- XMesaDestroyContext( glxCtx->xmesaContext );
- XMesaGarbageCollect();
- free(glxCtx);
+ if (ctx) {
+ GLXContext glxCtx = ctx;
+ (void) dpy;
+ MakeCurrent_PrevContext = 0;
+ MakeCurrent_PrevDrawable = 0;
+ MakeCurrent_PrevReadable = 0;
+ MakeCurrent_PrevDrawBuffer = 0;
+ MakeCurrent_PrevReadBuffer = 0;
+ XMesaDestroyContext( glxCtx->xmesaContext );
+ XMesaGarbageCollect();
+ free(glxCtx);
+ }
}