aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2014-02-11 11:07:37 +0100
committerJohannes Schickel2014-02-11 11:10:48 +0100
commit602d3034a97517ecdaabde14a8b4928ddb3b9303 (patch)
treeb3cb3c22a3be9aabfed22a542055b8e1124f435d
parent1970bf81e5591e95a9c5c5aa682afacc05327886 (diff)
downloadscummvm-rg350-602d3034a97517ecdaabde14a8b4928ddb3b9303.tar.gz
scummvm-rg350-602d3034a97517ecdaabde14a8b4928ddb3b9303.tar.bz2
scummvm-rg350-602d3034a97517ecdaabde14a8b4928ddb3b9303.zip
OPENGL: Release old texture name before creating a new one.
This prevents any texture name leaks (and thus memory leaks) on recreateInternalTexture calls.
-rw-r--r--backends/graphics/opengl/texture.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp
index 8f17ed7eeb..dff483dc0d 100644
--- a/backends/graphics/opengl/texture.cpp
+++ b/backends/graphics/opengl/texture.cpp
@@ -65,6 +65,9 @@ void Texture::releaseInternalTexture() {
}
void Texture::recreateInternalTexture() {
+ // Release old texture name in case it exists.
+ releaseInternalTexture();
+
// Get a new texture name.
GLCALL(glGenTextures(1, &_glTexture));