summaryrefslogtreecommitdiffstats
path: root/src/glx/glx_pbuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/glx_pbuffer.c')
-rw-r--r--src/glx/glx_pbuffer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index 0e74e7ccd0e..6738252a31d 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -396,6 +396,7 @@ CreateDrawable(Display *dpy, struct glx_config *config,
Drawable drawable, const int *attrib_list, CARD8 glxCode)
{
xGLXCreateWindowReq *req;
+ struct glx_drawable *glxDraw;
CARD32 *data;
unsigned int i;
CARD8 opcode;
@@ -411,6 +412,10 @@ CreateDrawable(Display *dpy, struct glx_config *config,
if (!opcode)
return None;
+ glxDraw = Xmalloc(sizeof(*glxDraw));
+ if (!glxDraw)
+ return None;
+
LockDisplay(dpy);
GetReqExtra(GLXCreateWindow, 8 * i, req);
data = (CARD32 *) (req + 1);
@@ -429,6 +434,11 @@ CreateDrawable(Display *dpy, struct glx_config *config,
UnlockDisplay(dpy);
SyncHandle();
+ if (InitGLXDrawable(dpy, glxDraw, drawable, xid)) {
+ free(glxDraw);
+ return None;
+ }
+
if (!CreateDRIDrawable(dpy, config, drawable, xid, attrib_list, i)) {
if (glxCode == X_GLXCreatePixmap)
glxCode = X_GLXDestroyPixmap;
@@ -454,6 +464,7 @@ DestroyDrawable(Display * dpy, GLXDrawable drawable, CARD32 glxCode)
protocolDestroyDrawable(dpy, drawable, glxCode);
+ DestroyGLXDrawable(dpy, drawable);
DestroyDRIDrawable(dpy, drawable, GL_FALSE);
return;