Salome HOME
0022323: [CEA 914] YACS: quantity of resources in OptimizerLoop
authorvsr <vsr@opencascade.com>
Tue, 24 Feb 2015 14:27:45 +0000 (17:27 +0300)
committervsr <vsr@opencascade.com>
Thu, 23 Apr 2015 14:34:18 +0000 (17:34 +0300)
src/engine/OptimizerLoop.cxx

index d36affd030b9eff1b1afc03fbb898a0969eec372..53c67c7ac5af16203f5bd413720f56d0275e510e 100644 (file)
@@ -170,7 +170,6 @@ void OptimizerLoop::exUpdateState()
 
           // Initialize and launch the algorithm
           _alg->initializeProxy(_algoInitPort.getValue());
-          _alg->startProxy();
           if (_alg->hasError()) {
             string error = _alg->getError();
             _alg->finishProxy();
@@ -181,6 +180,14 @@ void OptimizerLoop::exUpdateState()
           int i;
           int nbOfBr=_nbOfBranches.getIntValue();
           _alg->setNbOfBranches(nbOfBr);
+
+          _alg->startProxy();
+          if (_alg->hasError()) {
+            string error = _alg->getError();
+            _alg->finishProxy();
+            throw Exception(error);
+          }
+
           if(nbOfBr==0)
             {
               // A number of branches of 0 is acceptable if there are no output ports