From 2ea6380040e934802de2ed65abeb074c98304b4a Mon Sep 17 00:00:00 2001 From: dhewg Date: Thu, 17 Mar 2011 18:23:37 +0100 Subject: ANDROID: Plug RGB cursor memleak --- backends/platform/android/gfx.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'backends') diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index d7e31fcad7..ec98c35f42 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -679,10 +679,13 @@ void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h, #ifdef USE_RGB_COLOR if (format && format->bytesPerPixel > 1) { - if (_mouse_texture != _mouse_texture_rgb) + if (_mouse_texture != _mouse_texture_rgb) { LOGD("switching to rgb mouse cursor"); - _mouse_texture_rgb = new GLES5551Texture(); + assert(!_mouse_texture_rgb); + _mouse_texture_rgb = new GLES5551Texture(); + } + _mouse_texture = _mouse_texture_rgb; } else { if (_mouse_texture != _mouse_texture_palette) -- cgit v1.2.3