aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2018-10-21 14:42:02 -0700
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit71389c2dd2b0af525c8f458cee723b61dcfeb614 (patch)
tree09977979387250cbf307875c9d00759bb3b3e43e /engines
parent5bfdffc9dc2b811dccd050c9d70200416465bb50 (diff)
downloadscummvm-rg350-71389c2dd2b0af525c8f458cee723b61dcfeb614.tar.gz
scummvm-rg350-71389c2dd2b0af525c8f458cee723b61dcfeb614.tar.bz2
scummvm-rg350-71389c2dd2b0af525c8f458cee723b61dcfeb614.zip
GLK: Added window class destructors
Diffstat (limited to 'engines')
-rw-r--r--engines/gargoyle/windows.cpp32
-rw-r--r--engines/gargoyle/windows.h15
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;