Prevent double unref of glxdrawables

Found by valgrind. Bug #18917.
This commit is contained in:
Pierre Willenbrock 2009-01-30 21:16:48 -08:00 • committed by Eric Anholt
commit 29b3b88dc7
2 changed files with 4 additions and 3 deletions

View file

@ -146,6 +146,8 @@ __glXContextDestroy(__GLXcontext *context)
__glXUnrefDrawable(context->drawPriv);
if (context->readPriv)
__glXUnrefDrawable(context->readPriv);
context->drawPriv = NULL;
context->readPriv = NULL;
}
__glXFlushContextCache();
}
@ -621,6 +623,8 @@ DoMakeCurrent(__GLXclientState *cl,
__glXUnrefDrawable(prevglxc->drawPriv);
if (prevglxc->readPriv)
__glXUnrefDrawable(prevglxc->readPriv);
prevglxc->drawPriv = NULL;
prevglxc->readPriv = NULL;
}
}