diff --git a/apps/openmw/mwgui/spellwindow.cpp b/apps/openmw/mwgui/spellwindow.cpp index 20db95fc19..f41990ac41 100644 --- a/apps/openmw/mwgui/spellwindow.cpp +++ b/apps/openmw/mwgui/spellwindow.cpp @@ -34,7 +34,7 @@ namespace MWGui , mSpellView(nullptr) , mUpdateTimer(0.0f) { - mSpellIcons = new SpellIcons(); + mSpellIcons = std::make_unique(); MyGUI::Widget* deleteButton; getWidget(deleteButton, "DeleteSpellButton"); @@ -54,11 +54,6 @@ namespace MWGui mFilterEdit->setSize(filterWidth, mFilterEdit->getSize().height); } - SpellWindow::~SpellWindow() - { - delete mSpellIcons; - } - void SpellWindow::onPinToggled() { Settings::Manager::setBool("spells pin", "Windows", mPinned); diff --git a/apps/openmw/mwgui/spellwindow.hpp b/apps/openmw/mwgui/spellwindow.hpp index 786a7d877f..d262524414 100644 --- a/apps/openmw/mwgui/spellwindow.hpp +++ b/apps/openmw/mwgui/spellwindow.hpp @@ -1,6 +1,8 @@ #ifndef MWGUI_SPELLWINDOW_H #define MWGUI_SPELLWINDOW_H +#include + #include "windowpinnablebase.hpp" #include "spellmodel.hpp" @@ -14,7 +16,6 @@ namespace MWGui { public: SpellWindow(DragAndDrop* drag); - virtual ~SpellWindow(); void updateSpells(); @@ -41,7 +42,7 @@ namespace MWGui void onOpen() override; SpellView* mSpellView; - SpellIcons* mSpellIcons; + std::unique_ptr mSpellIcons; MyGUI::EditBox* mFilterEdit; private: