summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorTilman Sauerbeck <[email protected]>2006-07-11 18:35:24 +0000
committerTilman Sauerbeck <[email protected]>2006-07-11 18:35:24 +0000
commitaead688e7fc605fada2624626c7543445412791a (patch)
tree278e6795a1bc4e702a98551acd68b7f44a8a9a91 /src/mesa/drivers
parentbbe197ec1d29647884ec4b2dd5812ff7b0cc8b05 (diff)
_mesa_destroy_context() frees radeon->glCtx so we must not access it afterwards
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/r300/radeon_context.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c
index 5de16104f0a..d886788b341 100644
--- a/src/mesa/drivers/dri/r300/radeon_context.c
+++ b/src/mesa/drivers/dri/r300/radeon_context.c
@@ -201,14 +201,15 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
*/
void radeonCleanupContext(radeonContextPtr radeon)
{
+ /* _mesa_destroy_context() might result in calls to functions that
+ * depend on the DriverCtx, so don't set it to NULL before.
+ *
+ * radeon->glCtx->DriverCtx = NULL;
+ */
+
/* free the Mesa context */
_mesa_destroy_context(radeon->glCtx);
- /* the above call might result in calls to functions that depend on
- * the DriverCtx.
- */
- radeon->glCtx->DriverCtx = NULL;
-
if (radeon->state.scissor.pClipRects) {
FREE(radeon->state.scissor.pClipRects);
radeon->state.scissor.pClipRects = 0;