Salome HOME
PAL8521
[modules/superv.git] / src / Supervision / ESNode_Impl.cxx
index 0329f2d1b0acb7e5f7b8315aec2358573f163196..1cb438e4cfe77c0a0ddc71b75a8da921db9247c6 100644 (file)
@@ -79,30 +79,37 @@ ESNode_Impl::~ESNode_Impl() {
 void ESNode_Impl::destroy() {
   beginService( "ESNode_Impl::Destroy" );
   if ( DataFlowEditor()->IsEditing() ) {
-    SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
+//    SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
     if ( Delete() ) {
       _poa->deactivate_object(*_id) ;
       CORBA::release(_poa) ;
       delete(_id) ;
       _thisObj->_remove_ref();
     }
-    if ( !CORBA::is_nil( aCoupled ) ) {
-      aCoupled->SetCoupled( "" ) ;
-      aCoupled->destroy() ;
+    else {
+      MESSAGE("ESNode_Impl::destroy ERROR ") ;
     }
+// destroy have to be used for the SwitchNode ==> destroy of the EndSwitchNode
+//    if ( !CORBA::is_nil( aCoupled ) ) {
+//      aCoupled->SetCoupled( "" ) ;
+//      aCoupled->destroy() ;
+//    }
   }
-//  endService( "ESNode_Impl::Destroy" );
+  endService( "ESNode_Impl::Destroy" );
 }
 
 bool ESNode_Impl::Delete() {
-//  beginService( "ESNode_Impl::Delete" );
+  beginService( "ESNode_Impl::Delete" );
   bool RetVal = false ;
   if ( DataFlowEditor()->IsEditing() ) {
+    DeletePorts() ;
     RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
-    if ( RetVal )
-      RetVal = DataFlowEditor()->IsValid() ;
+// IsValid is done in SNode_Impl::Delete
+//    if ( RetVal ) {
+//      RetVal = DataFlowEditor()->IsValid() ;
+//    }
   }
-//  endService( "ESNode_Impl::Delete" );
+  endService( "ESNode_Impl::Delete" );
   return RetVal ;
 }