summaryrefslogtreecommitdiff
path: root/GL
diff options
context:
space:
mode:
Diffstat (limited to 'GL')
-rw-r--r--GL/glx/glxdri.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index 613ac05f1..f9b28e427 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -653,6 +653,9 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
&context->driContext);
if (context->driContext.private == NULL) {
+ __glXenterServer(GL_FALSE);
+ retval = DRIDestroyContext(baseScreen->pScreen, context->hwContextID);
+ __glXleaveServer(GL_FALSE);
xfree(context);
return NULL;
}
@@ -703,6 +706,14 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
&private->driDrawable,
hwDrawable, 0, NULL);
+ if (private->driDrawable.private == NULL) {
+ __glXenterServer(GL_FALSE);
+ DRIDestroyDrawable(screen->pScreen, serverClient, pDraw);
+ __glXleaveServer(GL_FALSE);
+ xfree(private);
+ return NULL;
+ }
+
return &private->base;
}