From f4709898524b2bcdff3553c8b22b123b2d214f9b Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 3 Nov 2005 08:06:54 +0000 Subject: [PATCH] Reparent childern from old Root when set new Root --- src/SUIT/SUIT_Study.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SUIT/SUIT_Study.cxx b/src/SUIT/SUIT_Study.cxx index 9c2af0282..799641f16 100755 --- a/src/SUIT/SUIT_Study.cxx +++ b/src/SUIT/SUIT_Study.cxx @@ -192,6 +192,10 @@ void SUIT_Study::setRoot( SUIT_DataObject* obj ) if ( myRoot == obj ) return; + // This is necessary in order not to destroy the complete tree of objects + if ( obj ) + obj->reparentChildren( myRoot ); + delete myRoot; myRoot = obj; } -- 2.39.2