From ea3d410c5b3c43ea45ef117fa2948811f87f5891 Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 7 Nov 2005 07:10:44 +0000 Subject: [PATCH] PAL10445 - incorrect deletion of references in VISU --- src/VISUGUI/VisuGUI_Tools.cxx | 4 ---- src/VISU_I/VISUConfig.cc | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 191964a2..7dc5ded7 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -399,9 +399,6 @@ namespace VISU _PTR(SObject) aChildSObject = aChildIter->Value(); CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject); - VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(aChildObj); - if( !CORBA::is_nil( aRemovableObject ) ) - study->deleteReferencesTo( aChildSObject ); ErasePrs(theModule, aChildObj); } @@ -411,7 +408,6 @@ namespace VISU VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObj); if (!CORBA::is_nil(aRemovableObject)) { - study->deleteReferencesTo( theSObject ); aRemovableObject->RemoveFromStudy(); } } else { diff --git a/src/VISU_I/VISUConfig.cc b/src/VISU_I/VISUConfig.cc index 30cb7c4f..56ef09c5 100644 --- a/src/VISU_I/VISUConfig.cc +++ b/src/VISU_I/VISUConfig.cc @@ -441,6 +441,18 @@ namespace VISU{ } } + // asl, fix for PAL10455: Remove references to SObject + SALOMEDS::Study::ListOfSObject* aRefs = aStudyDocument->FindDependances( theSObject ); + for( int i=0, n=aRefs->length(); iGetFatherComponent()->ComponentDataType()==theSObject->GetFatherComponent()->ComponentDataType() ) + { + aStudyBuilder->RemoveReference( o ); + aStudyBuilder->RemoveObjectWithChildren( o ); + } + } + // Remove the SObject itself aStudyBuilder->RemoveObjectWithChildren(theSObject); } -- 2.39.2