From a2e73d7cee2910fe0d235d62f1b7cf3fd3fb3623 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 11 Jan 2023 12:29:46 +0100 Subject: [PATCH] Move prepareForDelete() to Rim3dView --- ApplicationLibCode/Commands/RicDeleteItemExec.cpp | 3 --- ApplicationLibCode/ProjectDataModel/Rim3dView.cpp | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/Commands/RicDeleteItemExec.cpp b/ApplicationLibCode/Commands/RicDeleteItemExec.cpp index 86b4c0315d..19f4a932c5 100644 --- a/ApplicationLibCode/Commands/RicDeleteItemExec.cpp +++ b/ApplicationLibCode/Commands/RicDeleteItemExec.cpp @@ -65,9 +65,6 @@ void RicDeleteItemExec::redo() m_commandData.m_deletedObjectAsXml = xmlObj( obj )->writeObjectToXmlString(); } - // Make sure the object is disconnected from other objects before delete - obj->prepareForDelete(); - delete obj; listField->erase( m_commandData.m_indexToObject ); diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp index aacec23df9..b21d690564 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp +++ b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp @@ -235,6 +235,10 @@ Rim3dView::~Rim3dView() { m_viewer->clearRimView(); } + + // Make sure the object is disconnected from other objects before delete + prepareForDelete(); + removeMdiWindowFromMdiArea(); delete m_viewer;