Salome HOME
Fix for bug PAL5744. Ecole_Ete_a5
authorsmh <smh@opencascade.com>
Thu, 13 May 2004 13:08:57 +0000 (13:08 +0000)
committersmh <smh@opencascade.com>
Thu, 13 May 2004 13:08:57 +0000 (13:08 +0000)
src/SUPERVGUI/SUPERVGUI_Graph.cxx

index 1d6b1ac06b68a045ab8efc74a76b64b3a5ce0a35..d1feb174982ca53c7481c501d00d844e2018e65c 100644 (file)
@@ -326,21 +326,27 @@ void SUPERVGUI_Graph::deleteLink() {
 
 
 void SUPERVGUI_Graph::deleteLink(SUPERVGUI_Link* theLink) {
-  //update values of input ports of theLink if theLink is deleted
-  if ( theLink->getInputPort() ) {
-    //input port exist
+  if (getMain()->getDataflow()->IsDone()) {
+    //update values of input ports of theLink if theLink is deleted and dataflow has been executed any times
     SUPERVGUI_PortIn* aInPort = theLink->getInputPort();
-    if (aInPort->getPort()->IsParam() || aInPort->getPort()->IsInLine()) {
-      QString aPortValue = QString(aInPort->getPort()->ToString()); 
-      if (!aPortValue.isNull()) {
+    if ( aInPort ) {
+      //input port exist
+      QString aPortValue = QString(aInPort->getPort()->ToString());
+      if ( (aInPort->getPort()->IsParam() || aInPort->getPort()->IsInLine())
+          &&
+          !aPortValue.isNull()) {
        //gives a value to an input port
        theLink->destroyEngine();
        aInPort->getPort()->Input( Supervision.getEngine()->StringValue( aPortValue ) );
        aInPort->sync();
       }
+      else 
+       theLink->destroyEngine();
     }
+    else
+      theLink->destroyEngine(); 
   }
-  else 
+  else
     theLink->destroyEngine();
 
   myLinksList.removeRef(theLink);