summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/texstate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 5453331c67..6e0c0c688a 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -791,6 +791,9 @@ _mesa_free_texture_data(GLcontext *ctx)
/* unreference current textures */
for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) {
+ /* The _Current texture could account for another reference */
+ _mesa_reference_texobj(&ctx->Texture.Unit[u]._Current, NULL);
+
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
_mesa_reference_texobj(&ctx->Texture.Unit[u].CurrentTex[tgt], NULL);
}