summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp10
-rw-r--r--src/gui/windows/skilldialog.cpp7
2 files changed, 9 insertions, 8 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();
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 69e5f5bf3..b973c09be 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -874,8 +874,11 @@ void SkillDialog::useSkillTarget(const SkillInfo *const info,
{
if (!being && autoTarget == AutoTarget_true)
{
- being = localPlayer->setNewTarget(ActorType::Monster,
- AllowSort_true);
+ if (localPlayer)
+ {
+ being = localPlayer->setNewTarget(ActorType::Monster,
+ AllowSort_true);
+ }
}
if (being)
{