mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 19:45:07 +00:00
GLK: Freeing of data on exit
This commit is contained in:
parent
3d34cd151f
commit
4b011b2f1c
@ -65,14 +65,21 @@ WindowMask::WindowMask() : _hor(0), _ver(0), _links(nullptr) {
|
||||
resize(g_system->getWidth(), g_system->getHeight());
|
||||
}
|
||||
|
||||
void WindowMask::resize(size_t x, size_t y) {
|
||||
// Deallocate old storage
|
||||
WindowMask::~WindowMask() {
|
||||
clear();
|
||||
}
|
||||
|
||||
void WindowMask::clear() {
|
||||
for (size_t i = 0; i < _hor; i++) {
|
||||
if (_links[i])
|
||||
delete _links[i];
|
||||
}
|
||||
|
||||
delete _links;
|
||||
}
|
||||
|
||||
void WindowMask::resize(size_t x, size_t y) {
|
||||
clear();
|
||||
|
||||
_hor = x + 1;
|
||||
_ver = y + 1;
|
||||
|
@ -63,6 +63,11 @@ public:
|
||||
* Manages hyperlinks for the screen
|
||||
*/
|
||||
class WindowMask {
|
||||
private:
|
||||
/**
|
||||
* Clear the links data
|
||||
*/
|
||||
void clear();
|
||||
public:
|
||||
size_t _hor, _ver;
|
||||
glui32 **_links;
|
||||
@ -74,6 +79,11 @@ public:
|
||||
*/
|
||||
WindowMask();
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~WindowMask();
|
||||
|
||||
/**
|
||||
* Resize the links array
|
||||
*/
|
||||
|
@ -70,6 +70,10 @@ Windows::Windows(Graphics::Screen *screen) : _screen(screen), _windowList(nullpt
|
||||
_zcolor_Bright[0] = _zcolor_Bright[1] = _zcolor_Bright[2] = 0;
|
||||
}
|
||||
|
||||
Windows::~Windows() {
|
||||
delete _rootWin;
|
||||
}
|
||||
|
||||
Window *Windows::windowOpen(Window *splitwin, glui32 method, glui32 size,
|
||||
glui32 wintype, glui32 rock) {
|
||||
Window *newwin, *oldparent;
|
||||
|
@ -151,6 +151,11 @@ public:
|
||||
*/
|
||||
Windows(Graphics::Screen *screen);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~Windows();
|
||||
|
||||
/**
|
||||
* Open a new window
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user