diff options
author | dhewg | 2011-03-02 23:00:48 +0100 |
---|---|---|
committer | dhewg | 2011-03-02 23:18:36 +0100 |
commit | 2d4a64d18493b142b1899a822202015339733cfa (patch) | |
tree | fb954f21d4a2023d04425b9e5b9f8ebf688d9d72 /backends/platform/android/texture.cpp | |
parent | c2d4cce429baa56b5a0962a854ece6163270995f (diff) | |
download | scummvm-rg350-2d4a64d18493b142b1899a822202015339733cfa.tar.gz scummvm-rg350-2d4a64d18493b142b1899a822202015339733cfa.tar.bz2 scummvm-rg350-2d4a64d18493b142b1899a822202015339733cfa.zip |
ANDROID: Properly release texture resources
When calling glDeleteTextures() we need a valid surface.
Diffstat (limited to 'backends/platform/android/texture.cpp')
-rw-r--r-- | backends/platform/android/texture.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index 9840e7d5c5..ea8a89df78 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -98,12 +98,15 @@ GLESTexture::GLESTexture() : } GLESTexture::~GLESTexture() { + release(); +} + +void GLESTexture::release() { debug("Destroying texture %u", _texture_name); GLCALL(glDeleteTextures(1, &_texture_name)); } -void GLESTexture::reinitGL() { - GLCALL(glDeleteTextures(1, &_texture_name)); +void GLESTexture::reinit() { GLCALL(glGenTextures(1, &_texture_name)); // bypass allocBuffer() shortcut to reinit the texture properly |