summaryrefslogtreecommitdiffstats
path: root/src/glx/glxcmds.c
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2011-03-31 20:43:57 +0000
committerAdam Jackson <[email protected]>2011-06-29 14:07:19 -0400
commit4833104718677caad0027d5e7539ca9bba389392 (patch)
treef14a20f76dc0989b58e95b88e4c4fc65bef73f9e /src/glx/glxcmds.c
parent9e2bc5d4b0385e374e06c0b26db266067a723bf3 (diff)
glx: Verify that drawable creation on the client side actually worked
... and clean up if it didn't. Signed-off-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/glx/glxcmds.c')
-rw-r--r--src/glx/glxcmds.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 21068184ce2..191b321ce32 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -640,19 +640,33 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap)
psc = priv->screens[vis->screen];
if (psc->driScreen == NULL)
- break;
+ return xid;
+
config = glx_config_find_visual(psc->visuals, vis->visualid);
pdraw = psc->driScreen->createDrawable(psc, pixmap, xid, config);
if (pdraw == NULL) {
fprintf(stderr, "failed to create pixmap\n");
+ xid = None;
break;
}
if (__glxHashInsert(priv->drawHash, xid, pdraw)) {
(*pdraw->destroyDrawable) (pdraw);
- return None; /* FIXME: Check what we're supposed to do here... */
+ xid = None;
+ break;
}
} while (0);
+
+ if (xid == None) {
+ xGLXDestroyGLXPixmapReq *dreq;
+ LockDisplay(dpy);
+ GetReq(GLXDestroyGLXPixmap, dreq);
+ dreq->reqType = opcode;
+ dreq->glxCode = X_GLXDestroyGLXPixmap;
+ dreq->glxpixmap = xid;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ }
#endif
return xid;