diff options
author | Johannes Schickel | 2014-02-11 11:07:37 +0100 |
---|---|---|
committer | Johannes Schickel | 2014-02-11 11:10:48 +0100 |
commit | 602d3034a97517ecdaabde14a8b4928ddb3b9303 (patch) | |
tree | b3cb3c22a3be9aabfed22a542055b8e1124f435d | |
parent | 1970bf81e5591e95a9c5c5aa682afacc05327886 (diff) | |
download | scummvm-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.cpp | 3 |
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)); |