From: asl Date: Mon, 7 Nov 2005 07:10:44 +0000 (+0000) Subject: PAL10445 - incorrect deletion of references in VISU X-Git-Tag: V3_1_0a3~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ea3d410c5b3c43ea45ef117fa2948811f87f5891;p=modules%2Fvisu.git PAL10445 - incorrect deletion of references in VISU --- 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); }