Properly clean up memory when destroying CursorManager.

svn-id: r46325
This commit is contained in:
Johannes Schickel 2009-12-09 23:05:15 +00:00
parent 7605a35fd7
commit dce1d4aa4b
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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;