summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-10-22 15:16:53 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-10-22 15:16:53 +0000
commit04a1daf63b26f57e9b48c32bbd3ab361c6a7eb39 (patch)
treee5d1a18290dd87ba71f2b6133628658ff27c872c
parent84aedaafc055f8d2c7f403c007aca848f611ddf9 (diff)
fix refcount, add missing texrect code in _mesa_DeleteTextures()
-rw-r--r--src/mesa/main/texobj.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 65d7657b48..3d813dbd13 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1,4 +1,4 @@
-/* $Id: texobj.c,v 1.50.2.2 2002/08/28 01:13:36 brianp Exp $ */
+/* $Id: texobj.c,v 1.50.2.3 2002/10/22 15:16:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -556,27 +556,38 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *texName)
if (delObj == unit->Current1D) {
unit->Current1D = ctx->Shared->Default1D;
ctx->Shared->Default1D->RefCount++;
+ delObj->RefCount--;
if (delObj == unit->_Current)
unit->_Current = unit->Current1D;
}
else if (delObj == unit->Current2D) {
unit->Current2D = ctx->Shared->Default2D;
ctx->Shared->Default2D->RefCount++;
+ delObj->RefCount--;
if (delObj == unit->_Current)
unit->_Current = unit->Current2D;
}
else if (delObj == unit->Current3D) {
unit->Current3D = ctx->Shared->Default3D;
ctx->Shared->Default3D->RefCount++;
+ delObj->RefCount--;
if (delObj == unit->_Current)
unit->_Current = unit->Current3D;
}
else if (delObj == unit->CurrentCubeMap) {
unit->CurrentCubeMap = ctx->Shared->DefaultCubeMap;
ctx->Shared->DefaultCubeMap->RefCount++;
+ delObj->RefCount--;
if (delObj == unit->_Current)
unit->_Current = unit->CurrentCubeMap;
}
+ else if (delObj == unit->CurrentRect) {
+ unit->CurrentRect = ctx->Shared->DefaultRect;
+ ctx->Shared->DefaultRect->RefCount++;
+ delObj->RefCount--;
+ if (delObj == unit->_Current)
+ unit->_Current = unit->CurrentRect;
+ }
}
ctx->NewState |= _NEW_TEXTURE;