summaryrefslogtreecommitdiffstats
path: root/source/LuaWindow.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-18 01:36:51 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-18 01:36:51 +0200
commit7014979bffdc08187c8b91c8aefcb0a862a85187 (patch)
treefd22d73a2485bda09caac3d948f752bca7e380c3 /source/LuaWindow.cpp
parentBugfix Update [SEE DESC} (diff)
parentFixed LuaWindow destructor causing a crash. (diff)
downloadcuberite-7014979bffdc08187c8b91c8aefcb0a862a85187.tar
cuberite-7014979bffdc08187c8b91c8aefcb0a862a85187.tar.gz
cuberite-7014979bffdc08187c8b91c8aefcb0a862a85187.tar.bz2
cuberite-7014979bffdc08187c8b91c8aefcb0a862a85187.tar.lz
cuberite-7014979bffdc08187c8b91c8aefcb0a862a85187.tar.xz
cuberite-7014979bffdc08187c8b91c8aefcb0a862a85187.tar.zst
cuberite-7014979bffdc08187c8b91c8aefcb0a862a85187.zip
Diffstat (limited to 'source/LuaWindow.cpp')
-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());
}