Salome HOME
Delete : ignore the return value of UnValid
[modules/superv.git] / src / Supervision / SNode_Impl.cxx
index 1d6b83e6faf1ef7763cd2956134590e600efb59f..3ea6e5025be5f47a94e50a071ea4ddd702a26881 100644 (file)
@@ -83,23 +83,31 @@ void SNode_Impl::destroy() {
       delete(_id) ;
       _thisObj->_remove_ref();
     }
+    else {
+      MESSAGE("SNode_Impl::destroy ERROR ") ;
+    }
     if ( !CORBA::is_nil( aCoupled ) ) {
-      aCoupled->SetCoupled( "" ) ;
+//      aCoupled->SetCoupled( "" ) ; : Used in GraphBase::Graph::RemoveNode( EndSwitchNode ) :
       aCoupled->destroy() ;
     }
+// Valid() only after deletion of the corresponding EndSwitchNode :
+    DataFlowEditor()->UnValid() ;
   }
-//  endService( "SNode_Impl::Destroy" );
+  endService( "SNode_Impl::Destroy" );
 }
 
 bool SNode_Impl::Delete() {
-//  beginService( "SNode_Impl::Delete" );
+  beginService( "SNode_Impl::Delete" );
   bool RetVal = false ;
   if ( DataFlowEditor()->IsEditing() ) {
+    DeletePorts() ;
     RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
-    if ( RetVal )
-      RetVal = DataFlowEditor()->IsValid() ;
+// Valid() only after deletion of the corresponding EndLoopNode :
+//    if ( RetVal ) {
+//      RetVal = DataFlowEditor()->IsValid() ;
+//    }
   }
-//  endService( "SNode_Impl::Delete" );
+  endService( "SNode_Impl::Delete" );
   return RetVal ;
 }