summaryrefslogtreecommitdiff
path: root/GL
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-02-27 17:06:27 +0000
committerAlan Hourihane <alanh@tungstengraphics.com>2008-02-27 17:06:27 +0000
commit41aea6194bd29ab34cc166b3fd90eee64299ddf8 (patch)
tree767c67dbf633f6c70bcb5374fe8638940c39327e /GL
parent43e46a654fa7cf69f0c8bcb7f583008d96a98686 (diff)
More checking for failed contexts/drawables
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;
}