diff options
-rw-r--r-- | engines/gargoyle/windows.cpp | 32 | ||||
-rw-r--r-- | engines/gargoyle/windows.h | 15 |
2 files changed, 47 insertions, 0 deletions
diff --git a/engines/gargoyle/windows.cpp b/engines/gargoyle/windows.cpp index 6070128743..ac16471b37 100644 --- a/engines/gargoyle/windows.cpp +++ b/engines/gargoyle/windows.cpp @@ -306,6 +306,16 @@ TextGridWindow::TextGridWindow(Windows *windows, uint32 rock) : Window(windows, Common::copy(&g_conf->_gStyles[0], &g_conf->_gStyles[style_NUMSTYLES], styles); } +TextGridWindow::~TextGridWindow() { + if (_inBuf) { + if (g_vm->gli_unregister_arr) + (*g_vm->gli_unregister_arr)(_inBuf, _inMax, "&+#!Cn", _inArrayRock); + _inBuf = nullptr; + } + + delete[] _lineTerminators; +} + void TextGridWindow::rearrange(const Common::Rect &box) { Window::rearrange(box); int newwid, newhgt; @@ -427,6 +437,24 @@ TextBufferWindow::TextBufferWindow(Windows *windows, uint32 rock) : Window(windo Common::copy(&g_conf->_tStyles[0], &g_conf->_tStyles[style_NUMSTYLES], styles); } +TextBufferWindow::~TextBufferWindow() { + if (_inBuf) { + if (g_vm->gli_unregister_arr) + (*g_vm->gli_unregister_arr)(_inBuf, _inMax, "&+#!Cn", _inArrayRock); + _inBuf = nullptr; + } + + delete[] _copyBuf; + delete[] _lineTerminators; + + for (int i = 0; i < _scrollBack; i++) { + if (_lines[i].lpic) + _lines[i].lpic->decrement(); + if (_lines[i].rpic) + _lines[i].rpic->decrement(); + } +} + void TextBufferWindow::rearrange(const Common::Rect &box) { Window::rearrange(box); int newwid, newhgt; @@ -936,6 +964,10 @@ _w(0), _h(0), _dirty(false), _surface(nullptr) { Common::copy(&_bgColor[0], &_bgColor[3], _bgnd); } +GraphicsWindow::~GraphicsWindow() { + delete _surface; +} + void GraphicsWindow::rearrange(const Common::Rect &box) { int newwid, newhgt; int bothwid, bothhgt; diff --git a/engines/gargoyle/windows.h b/engines/gargoyle/windows.h index 0d635fd513..24043c6548 100644 --- a/engines/gargoyle/windows.h +++ b/engines/gargoyle/windows.h @@ -334,6 +334,11 @@ public: TextGridWindow(Windows *windows, uint32 rock); /** + * Destructor + */ + virtual ~TextGridWindow(); + + /** * Rearranges the window */ virtual void rearrange(const Common::Rect &box) override; @@ -440,6 +445,11 @@ public: TextBufferWindow(Windows *windows, uint32 rock); /** + * Destructor + */ + virtual ~TextBufferWindow(); + + /** * Rearranges the window */ virtual void rearrange(const Common::Rect &box) override; @@ -478,6 +488,11 @@ public: GraphicsWindow(Windows *windows, uint32 rock); /** + * Destructor + */ + virtual ~GraphicsWindow(); + + /** * Rearranges the window */ virtual void rearrange(const Common::Rect &box) override; |