From f7f5b2c41516b11204ff2f253a822b3ac35dcbe0 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Thu, 29 Jun 2006 18:36:51 +0000 Subject: destroy left-over VBOs on shutdown --- src/mesa/drivers/dri/r300/r300_context.c | 8 ++++++-- src/mesa/drivers/dri/r300/radeon_context.c | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index d7f027dcb8..4dd1e8b501 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -385,8 +385,12 @@ static void r300FreeGartAllocations(r300ContextPtr r300) if (r300->rmm->u_list[i].ptr == NULL) { continue; } - - assert(r300->rmm->u_list[i].pending); + + /* check whether this buffer is still in use */ + if (!r300->rmm->u_list[i].pending) { + continue; + } + assert(r300->rmm->u_list[i].h_pending == 0); tries = 0; diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 4172fbcf83..5de16104f0 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -202,9 +202,13 @@ GLboolean radeonInitContext(radeonContextPtr radeon, void radeonCleanupContext(radeonContextPtr radeon) { /* free the Mesa context */ - radeon->glCtx->DriverCtx = NULL; _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; -- cgit v1.2.3