summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-18 00:39:15 +0200
committermadmaxoft <github@xoft.cz>2013-08-18 00:39:15 +0200
commit8fe6bb55dd542b50a4796fd6e23bf99d83b6acab (patch)
tree97a3b3c2f896e6ae125505c8d40427c8c23021f8
parentFixed assert failures in cLuaState when using it for pushing a StringVector. (diff)
downloadcuberite-8fe6bb55dd542b50a4796fd6e23bf99d83b6acab.tar
cuberite-8fe6bb55dd542b50a4796fd6e23bf99d83b6acab.tar.gz
cuberite-8fe6bb55dd542b50a4796fd6e23bf99d83b6acab.tar.bz2
cuberite-8fe6bb55dd542b50a4796fd6e23bf99d83b6acab.tar.lz
cuberite-8fe6bb55dd542b50a4796fd6e23bf99d83b6acab.tar.xz
cuberite-8fe6bb55dd542b50a4796fd6e23bf99d83b6acab.tar.zst
cuberite-8fe6bb55dd542b50a4796fd6e23bf99d83b6acab.zip
-rw-r--r--source/LuaWindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/LuaWindow.cpp b/source/LuaWindow.cpp
index 18cc7650e..1dcfc885f 100644
--- a/source/LuaWindow.cpp
+++ b/source/LuaWindow.cpp
@@ -48,6 +48,16 @@ cLuaWindow::cLuaWindow(cWindow::WindowType a_WindowType, int a_SlotsX, int a_Slo
cLuaWindow::~cLuaWindow()
{
+ m_Contents.RemoveListener(*this);
+
+ // Must delete slot areas now, because they are referencing this->m_Contents and would try to access it in cWindow's
+ // destructor, when the member is already gone.
+ for (cSlotAreas::iterator itr = m_SlotAreas.begin(), end = m_SlotAreas.end(); itr != end; ++itr)
+ {
+ delete *itr;
+ }
+ m_SlotAreas.clear();
+
ASSERT(m_OpenedBy.empty());
}