From 1b6b878965c774a5cb27a11dd4eb86f2f6354f7a Mon Sep 17 00:00:00 2001 From: mpa Date: Tue, 23 Sep 2014 16:32:40 +0400 Subject: [PATCH] Moved method which closes study in python console --- src/LightApp/LightApp_Application.cxx | 5 ----- src/SalomeApp/SalomeApp_Study.cxx | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) 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) ); -- 2.39.2