From: mpa Date: Tue, 23 Sep 2014 12:32:40 +0000 (+0400) Subject: Moved method which closes study in python console X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1b6b878965c774a5cb27a11dd4eb86f2f6354f7a;p=modules%2Fgui.git Moved method which closes study in python console --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 29ad892fd..d81f07848 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1660,11 +1660,6 @@ void LightApp_Application::onStudyClosed( SUIT_Study* s ) emit studyClosed(); activateModule( "" ); - -#ifndef DISABLE_PYCONSOLE - if( pythonConsole() ) - pythonConsole()->getInterp()->destroy(); -#endif } /*!Protected SLOT.On desktop activated.*/ diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 70bd944cb..b83431fa0 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -47,6 +47,11 @@ #include +#ifndef DISABLE_PYCONSOLE + #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first! + #include +#endif + #include "utilities.h" #include "SALOMEDS_Tool.hxx" @@ -730,6 +735,11 @@ void SalomeApp_Study::closeDocument(bool permanently) myStudyDS->detach( myObserver->_this() ); if ( permanently ) { SalomeApp_Application::studyMgr()->Close( studyPtr ); +#ifndef DISABLE_PYCONSOLE + SalomeApp_Application* app = dynamic_cast( application() ); + if( app->pythonConsole() ) + app->pythonConsole()->getInterp()->destroy(); +#endif } SALOMEDSClient_Study* aStudy = 0; setStudyDS( _PTR(Study)(aStudy) );