]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
PAL10445 - incorrect deletion of references in VISU
authorasl <asl@opencascade.com>
Mon, 7 Nov 2005 07:10:44 +0000 (07:10 +0000)
committerasl <asl@opencascade.com>
Mon, 7 Nov 2005 07:10:44 +0000 (07:10 +0000)
src/VISUGUI/VisuGUI_Tools.cxx
src/VISU_I/VISUConfig.cc

index 191964a2a94d8f6fff9665dc582d373e6d862c38..7dc5ded734063c6ad4f2c55ab3ae03d41776f9d5 100644 (file)
@@ -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 {
index 30cb7c4fa68c29b22e3b9b1ec12dd8b97233abf5..56ef09c5c0b1725a7c240de9b36378fc573ee5d7 100644 (file)
@@ -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(); i<n; i++ )
+    {
+      SALOMEDS::SObject_var o = (*aRefs)[i];
+      if( o->GetFatherComponent()->ComponentDataType()==theSObject->GetFatherComponent()->ComponentDataType() )
+      {
+       aStudyBuilder->RemoveReference( o );
+       aStudyBuilder->RemoveObjectWithChildren( o );
+      }
+    }
+
     // Remove the SObject itself
     aStudyBuilder->RemoveObjectWithChildren(theSObject);
   }