From 3528d6aeb67cdc47f28060b7cd1aafcef00a1611 Mon Sep 17 00:00:00 2001 From: asl Date: Tue, 19 Aug 2014 04:47:20 +0000 Subject: [PATCH] refs #418: crash on object remove --- src/HYDROGUI/HYDROGUI_DataModelSync.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_DataModelSync.cxx b/src/HYDROGUI/HYDROGUI_DataModelSync.cxx index 36405be2..5f148e9a 100644 --- a/src/HYDROGUI/HYDROGUI_DataModelSync.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModelSync.cxx @@ -17,12 +17,8 @@ void HYDROGUI_DataModelSync::deleteItemWithChildren( const suitPtr& theSuitPtr ) if( !theSuitPtr ) return; - DataObjectList aChildren; - theSuitPtr->children( aChildren ); - foreach( SUIT_DataObject* anObj, aChildren ) - deleteItemWithChildren( anObj ); - - delete theSuitPtr; + theSuitPtr->setAutoDeleteChildren( true ); + theSuitPtr->deleteLater(); } suitPtr HYDROGUI_DataModelSync::nullSrc() const -- 2.39.2