Commit 59490ff3 authored by Jean-Paul Saman's avatar Jean-Paul Saman

gl_destroy_textures: do not leak textures.

glIsTexture() only works when the texture under test has been bound to a target
(thus calling glBindTexture()).
parent 1b6da36d
...@@ -796,8 +796,10 @@ gl_destroy_texture( ...@@ -796,8 +796,10 @@ gl_destroy_texture(
abort(); abort();
glEnable(target); glEnable(target);
glBindTexture(target, *texture);
if (glIsTexture(*texture)) if (glIsTexture(*texture))
glDeleteTextures(1, texture); glDeleteTextures(1, texture);
glBindTexture(target, 0);
glDisable(target); glDisable(target);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment