aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-12-09 23:05:15 +0000
committerJohannes Schickel2009-12-09 23:05:15 +0000
commitdce1d4aa4b319a934e94e45c3a264c75207a6577 (patch)
tree50ac7300832ecbbd6d3259798cc843b77ce7fdd0
parent7605a35fd7695c292c8176b3ea885d2be03e35cf (diff)
downloadscummvm-rg350-dce1d4aa4b319a934e94e45c3a264c75207a6577.tar.gz
scummvm-rg350-dce1d4aa4b319a934e94e45c3a264c75207a6577.tar.bz2
scummvm-rg350-dce1d4aa4b319a934e94e45c3a264c75207a6577.zip
Properly clean up memory when destroying CursorManager.
svn-id: r46325
-rw-r--r--graphics/cursorman.cpp9
-rw-r--r--graphics/cursorman.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index c14dc0744f..f056cf86d4 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -31,6 +31,15 @@ DECLARE_SINGLETON(Graphics::CursorManager);
namespace Graphics {
+CursorManager::~CursorManager() {
+ for (int i = 0; i < _cursorStack.size(); ++i)
+ delete _cursorStack[i];
+ _cursorStack.clear();
+ for (int i = 0; i < _cursorPaletteStack.size(); ++i)
+ delete _cursorPaletteStack[i];
+ _cursorPaletteStack.clear();
+}
+
bool CursorManager::isVisible() {
if (_cursorStack.empty())
return false;
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 1a5c116232..3536f27f9e 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -165,6 +165,7 @@ private:
// ourselves, so it is private and thus there is no way to create this class
// except from the Singleton code.
CursorManager() {}
+ ~CursorManager();
struct Cursor {
byte *_data;