{
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));
return ;
YACS::ENGINE::AutoGIL gal;
_corbaConfigFileName=GetConfigAndPort(_port);
+ _isAttached=true; _isLaunched=true;
}
void YACSEvalSession::checkLaunched() const
class MyAutoThreadSaver
{
public:
- MyAutoThreadSaver():_save(PyEval_SaveThread()) { }
- ~MyAutoThreadSaver() { PyEval_RestoreThread(_save); }
+ MyAutoThreadSaver(bool isToSave):_isToSave(isToSave),_save(0) { if(_isToSave) _save=PyEval_SaveThread(); }
+ ~MyAutoThreadSaver() { if(_isToSave) PyEval_RestoreThread(_save); }
private:
+ bool _isToSave;
PyThreadState *_save;
};
YACS::ENGINE::Executor exe;
exe.setKeepGoingProperty(!stopASAP);
{
- MyAutoThreadSaver locker;
+ MyAutoThreadSaver locker(!session->isAttached());
exe.RunW(getUndergroundGeneratedGraph());
}
return getUndergroundGeneratedGraph()->getState()==YACS::DONE;