Properly clean up memory when destroying CursorManager.
svn-id: r46325
This commit is contained in:
parent
7605a35fd7
commit
dce1d4aa4b
2 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue