More checking for failed contexts/drawables

This commit is contained in:
Alan Hourihane 2008-02-27 17:06:27 +00:00
parent 43e46a654f
commit 41aea6194b

View File

@ -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;
}