summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2016-03-07 23:20:28 +0100
committerAdam Jackson <ajax@redhat.com>2016-03-11 13:14:33 -0500
commitdcbf88aea74a00a8e09ffdc4de2b555911eb90fb (patch)
tree6c808fabac4f5576b14abbf5cc7239cfb9748953
parentab197ee9478a0e4e7a276c03645657b4f22ae9c0 (diff)
glx: don't call pGlxDraw->destroy() if AddResource fails
AddResource will have called DrawableGone, which takes care of the destruction. Reviewed-by: RĂ©mi Cardona <remi@gentoo.org> Signed-off-by: Julien Cristau <jcristau@debian.org> (cherry picked from commit 59b9c3d5e4bf05aeaaac2ee4ea12c301a67aae2c)
-rw-r--r--glx/glxcmds.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 0416dac09..6eb3541d0 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -544,7 +544,6 @@ __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client,
/* since we are creating the drawablePrivate, drawId should be new */
if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) {
- pGlxDraw->destroy(pGlxDraw);
*error = BadAlloc;
return NULL;
}
@@ -1239,20 +1238,16 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen * pGlxScreen,
if (pGlxDraw == NULL)
return BadAlloc;
- if (!AddResource(glxDrawableId, __glXDrawableRes, pGlxDraw)) {
- pGlxDraw->destroy(pGlxDraw);
+ if (!AddResource(glxDrawableId, __glXDrawableRes, pGlxDraw))
return BadAlloc;
- }
/*
* Windows aren't refcounted, so track both the X and the GLX window
* so we get called regardless of destruction order.
*/
if (drawableId != glxDrawableId && type == GLX_DRAWABLE_WINDOW &&
- !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) {
- pGlxDraw->destroy(pGlxDraw);
+ !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw))
return BadAlloc;
- }
return Success;
}