Salome HOME
Squeeze memory of process hosting YACS graph
[modules/yacs.git] / src / engine / ComposedNode.cxx
index cc9f49fb138e6a55603fb0656d9f594bf8563788..ccb4f7917c93e4bee9fdf8d7c05e69aab0fb8bee 100644 (file)
@@ -307,13 +307,17 @@ bool ComposedNode::edAddLink(OutPort *start, InPort *end) throw(YACS::Exception)
     iterS=end->getNode()->_father;
 
   InPort *currentPortI=end;
+  bool isLoopProofLink(true),isFirstTurn(true);
   while(iterS!=lwstCmnAnctr)
     {
+      if(!isFirstTurn && iterS->isLoop())// isFirstTurn is a way to filter special inputs like nbBranches, splitPort... These special inputs are loopProof -> they must not be realeased by ForEachLoop::exUpdateState
+        isLoopProofLink=false;
       iterS->buildDelegateOf(currentPortI, start, allAscendanceOfNodeStart);
       iterS=iterS->_father;
+      isFirstTurn=false;
     }
   bool ret=(pO.first)->addInPort(currentPortI);
-  end->edNotifyReferencedBy(pO.second);
+  end->edNotifyReferencedBy(pO.second,isLoopProofLink);
   return ret;
 }