mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 02:44:56 +00:00
Properly clean up memory when destroying CursorManager.
svn-id: r46325
This commit is contained in:
parent
7605a35fd7
commit
dce1d4aa4b
@ -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…
x
Reference in New Issue
Block a user