diff options
author | Michel Dänzer <[email protected]> | 2009-05-14 11:07:49 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2009-05-14 11:13:06 +0200 |
commit | 09c04db3c900e4ed833d060853b48c7ca23697e1 (patch) | |
tree | 9545ec91bb3ad2ef88c4ad5293797961a48b0c17 /src/mesa/drivers/dri/r300/r300_context.c | |
parent | 99960393edb3d6c0d3702cf51b59c2e4189117c7 (diff) |
r300: Make sure to drop current hardware state reference to texture objects.
Fixes potential texture object leaks.
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_context.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_context.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 12bee1a8fbb..8f0effd83e2 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -43,6 +43,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/matrix.h" #include "main/extensions.h" #include "main/state.h" +#include "main/texobj.h" #include "main/bufferobj.h" #include "swrast/swrast.h" @@ -500,6 +501,7 @@ void r300DestroyContext(__DRIcontextPrivate * driContextPriv) r300ContextPtr r300 = (r300ContextPtr) driContextPriv->driverPrivate; radeonContextPtr radeon = (radeonContextPtr) r300; radeonContextPtr current = ctx ? RADEON_CONTEXT(ctx) : NULL; + int i; if (RADEON_DEBUG & DEBUG_DRI) { fprintf(stderr, "Destroying context !\n"); @@ -553,6 +555,11 @@ void r300DestroyContext(__DRIcontextPrivate * driContextPriv) assert(is_empty_list(&r300->swapped)); } + /* Drop texture object references from current hardware state */ + for (i = 0; i < 8; i++) { + _mesa_reference_texobj(&r300->state.texture.unit[i].texobj, NULL); + } + radeonCleanupContext(&r300->radeon); #ifdef USER_BUFFERS |