summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index f0a4137c1..410891416 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -275,7 +275,10 @@ Gui::~Gui()
if (windowContainer)
windowContainer->slowLogic();
- delete getTop();
+ Widget *top = mTop;
+ if (Widget::widgetExists(mTop))
+ setTop(nullptr);
+ delete top;
delete2(mGuiFont);
delete2(boldFont);
@@ -283,14 +286,9 @@ Gui::~Gui()
delete2(mSecureFont);
delete2(mInfoParticleFont);
delete2(mNpcFont);
-
delete2(guiInput);
-
delete2(theme);
- if (Widget::widgetExists(mTop))
- setTop(nullptr);
-
delete2(mFocusHandler);
Label::finalCleanup();
Tab::finalCleanup();