summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorPierre Willenbrock <pierre@pirsoft.de>2009-01-30 21:16:48 -0800
committerEric Anholt <eric@anholt.net>2009-02-01 09:06:43 -0800
commit29b3b88dc744f4919c6709747ddb7baac47486c5 (patch)
tree739071828ceea64ae03a6b467d82df0207f3c8d7 /glx
parent60bcdd687040db76490851d4b459284ce37020e0 (diff)
Prevent double unref of glxdrawables
Found by valgrind. Bug #18917.
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index af52672f1..33954ee64 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -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;
}
}