diff options
author | Aapo Tahkola <[email protected]> | 2006-01-15 13:53:54 +0000 |
---|---|---|
committer | Aapo Tahkola <[email protected]> | 2006-01-15 13:53:54 +0000 |
commit | 0f488bb16d36edfff892609c4f58ef467145d441 (patch) | |
tree | e505132c0e571afcbe5f262fd79d19c6aa880192 /src/mesa/drivers/dri/r300 | |
parent | 1bcc323857c2632035e588c33848ac3bc24d0fd3 (diff) |
Missing bits of code spotted by Tilman Sauerbeck
Diffstat (limited to 'src/mesa/drivers/dri/r300')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_context.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 4ff30cc0c63..0478f862242 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -375,6 +375,7 @@ void r300DestroyContext(__DRIcontextPrivate * driContextPriv) { GET_CURRENT_CONTEXT(ctx); r300ContextPtr r300 = (r300ContextPtr) driContextPriv->driverPrivate; + radeonContextPtr radeon = (radeonContextPtr) r300; radeonContextPtr current = ctx ? RADEON_CONTEXT(ctx) : NULL; if (RADEON_DEBUG & DEBUG_DRI) { @@ -398,9 +399,34 @@ void r300DestroyContext(__DRIcontextPrivate * driContextPriv) _tnl_DestroyContext(r300->radeon.glCtx); _ac_DestroyContext(r300->radeon.glCtx); _swrast_DestroyContext(r300->radeon.glCtx); - + + r300ReleaseArrays(r300->radeon.glCtx); + if (r300->dma.current.buf) { + r300ReleaseDmaRegion(r300, &r300->dma.current, __FUNCTION__ ); + r300FlushCmdBuf(r300, __FUNCTION__ ); + } + r300DestroyCmdBuf(r300); + if (radeon->state.scissor.pClipRects) { + FREE(radeon->state.scissor.pClipRects); + radeon->state.scissor.pClipRects = NULL; + } + + if (release_texture_heaps) { + /* This share group is about to go away, free our private + * texture object data. + */ + int i; + + for (i = 0; i < r300->nr_heaps; i++) { + driDestroyTextureHeap(r300->texture_heaps[i]); + r300->texture_heaps[i] = NULL; + } + + assert(is_empty_list(&r300->swapped)); + } + radeonCleanupContext(&r300->radeon); /* free the option cache */ |