aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx/glxext.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx/glxext.c')
-rw-r--r--xorg-server/glx/glxext.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c
index c2de3cedd..e41b881f2 100644
--- a/xorg-server/glx/glxext.c
+++ b/xorg-server/glx/glxext.c
@@ -66,6 +66,7 @@ static DevPrivateKeyRec glxClientPrivateKeyRec;
** Forward declarations.
*/
static int __glXDispatch(ClientPtr);
+static GLboolean __glXFreeContext(__GLXcontext * cx);
/*
** Called when the extension is reset.
@@ -133,6 +134,9 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid)
next = c->next;
if (c->currentClient &&
(c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
+ /* flush the context */
+ glFlush();
+ c->hasUnflushedCommands = GL_FALSE;
/* just force a re-bind the next time through */
(*c->loseCurrent) (c);
lastGLContext = NULL;
@@ -186,7 +190,7 @@ __glXRemoveFromContextList(__GLXcontext * cx)
/*
** Free a context.
*/
-GLboolean
+static GLboolean
__glXFreeContext(__GLXcontext * cx)
{
if (cx->idExists || cx->currentClient)
@@ -291,7 +295,7 @@ glxClientCallback(CallbackListPtr *list, void *closure, void *data)
c->loseCurrent(c);
lastGLContext = NULL;
c->currentClient = NULL;
- __glXFreeContext(c);
+ FreeResourceByType(c->id, __glXContextRes, FALSE);
}
}