Salome HOME
Now evalyfx can be used safely inside a SALOME module.
[modules/yacs.git] / src / evalyfx / YACSEvalSession.cxx
index 250202fa4f8635c558ceca03c2e31e73e83ed5e6..f89f076c0351bc2b22dc526227f5ea2a44a10e71 100644 (file)
@@ -49,7 +49,7 @@ YACSEvalSession::~YACSEvalSession()
 {
   delete _internal;
   YACS::ENGINE::AutoGIL gal;
-  if(isLaunched())
+  if(isLaunched() && !isAttached())
     {
       YACS::ENGINE::AutoPyRef terminateSession(PyObject_GetAttrString(_salomeInstance,const_cast<char *>("stop")));//new
       YACS::ENGINE::AutoPyRef res(PyObject_CallObject(terminateSession,0));
@@ -85,6 +85,7 @@ void YACSEvalSession::launchUsingCurrentSession()
     return ;
   YACS::ENGINE::AutoGIL gal;
   _corbaConfigFileName=GetConfigAndPort(_port);
+  _isAttached=true; _isLaunched=true;
 }
 
 void YACSEvalSession::checkLaunched() const