Mark ownership using unique_ptr in Atlas sections

And remove unused destructors.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2026-06-08 19:50:18 +02:00
parent 54b529ddac
commit f9af0e571a
3 changed files with 3 additions and 9 deletions
@@ -124,7 +124,6 @@ class AtObjClientData : public wxClientData
{
public:
AtObjClientData(const AtObj& obj) : obj(obj) {}
virtual ~AtObjClientData() {}
AtObj GetValue() { return obj; }
private:
AtObj obj;
@@ -316,17 +316,12 @@ ObjectSidebar::ObjectSidebar(
bottomBarContainer,
scenarioEditor.GetObjectSettings(),
scenarioEditor.GetMapSettings(),
m_Impl
m_Impl.get()
);
m_Impl->m_ToolConn = scenarioEditor.GetToolManager().GetCurrentTool().RegisterObserver(0, &ObjectSidebar::OnToolChange, this);
}
ObjectSidebar::~ObjectSidebar()
{
delete m_Impl;
}
void ObjectSidebar::OnToolChange(ITool* tool)
{
if (wxString(tool->GetClassInfo()->GetClassName()) == _T("ActorViewerTool"))
@@ -17,6 +17,7 @@
#include "tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.h"
#include <memory>
#include <wx/event.h>
class ITool;
@@ -28,7 +29,6 @@ class ObjectSidebar : public Sidebar
{
public:
ObjectSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer);
~ObjectSidebar();
void FilterObjects();
@@ -43,7 +43,7 @@ private:
void OnSelectObject(wxCommandEvent& evt);
void OnToggleExactFilter(wxCommandEvent& evt);
ObjectSidebarImpl* m_Impl;
std::unique_ptr<ObjectSidebarImpl> m_Impl;
DECLARE_EVENT_TABLE();
};