From 602d3034a97517ecdaabde14a8b4928ddb3b9303 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 11 Feb 2014 11:07:37 +0100 Subject: OPENGL: Release old texture name before creating a new one. This prevents any texture name leaks (and thus memory leaks) on recreateInternalTexture calls. --- backends/graphics/opengl/texture.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends/graphics') 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)); -- cgit v1.2.3