diff --git a/src/Editor/WorldEditor/CWorldInfoSidebar.cpp b/src/Editor/WorldEditor/CWorldInfoSidebar.cpp index 76fe14bf..a40dc26d 100644 --- a/src/Editor/WorldEditor/CWorldInfoSidebar.cpp +++ b/src/Editor/WorldEditor/CWorldInfoSidebar.cpp @@ -5,7 +5,7 @@ CWorldInfoSidebar::CWorldInfoSidebar(CWorldEditor *pEditor) : CWorldEditorSidebar(pEditor) - , mpUI(new Ui::CWorldInfoSidebar) + , mpUI(std::make_unique()) , mModel(pEditor) { mpUI->setupUi(this); @@ -45,10 +45,7 @@ CWorldInfoSidebar::CWorldInfoSidebar(CWorldEditor *pEditor) mpUI->AreaNameSelector->SetEditable(false); } -CWorldInfoSidebar::~CWorldInfoSidebar() -{ - delete mpUI; -} +CWorldInfoSidebar::~CWorldInfoSidebar() = default; // ************ SLOTS ************ void CWorldInfoSidebar::OnActiveProjectChanged(CGameProject *pProj) diff --git a/src/Editor/WorldEditor/CWorldInfoSidebar.h b/src/Editor/WorldEditor/CWorldInfoSidebar.h index bbf0cc6f..2554b7db 100644 --- a/src/Editor/WorldEditor/CWorldInfoSidebar.h +++ b/src/Editor/WorldEditor/CWorldInfoSidebar.h @@ -6,6 +6,8 @@ #include "CWorldEditorSidebar.h" #include "CWorldTreeModel.h" +#include + class CWorldEditor; namespace Ui { @@ -16,13 +18,13 @@ class CWorldInfoSidebar : public CWorldEditorSidebar { Q_OBJECT - Ui::CWorldInfoSidebar *mpUI; + std::unique_ptr mpUI; CWorldTreeModel mModel; CWorldTreeProxyModel mProxyModel; public: explicit CWorldInfoSidebar(CWorldEditor *pEditor); - ~CWorldInfoSidebar(); + ~CWorldInfoSidebar() override; public slots: void OnActiveProjectChanged(CGameProject *pProj);