From: vsr Date: Fri, 27 Feb 2009 16:33:56 +0000 (+0000) Subject: Issue 0020165: fix crash on new study creation when single Python module is in the... X-Git-Tag: V5_1_1a2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=920b19fdf0bf261108c246fcbf02a9d81df57335;p=modules%2Fgui.git Issue 0020165: fix crash on new study creation when single Python module is in the session --- diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.cxx index 15d152860..5d2228cd1 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.cxx @@ -39,6 +39,19 @@ SALOME_PYQT_PyInterp::~SALOME_PYQT_PyInterp() { } +void SALOME_PYQT_PyInterp::initPython() +{ + /* + * Do nothing + * The initialization has been done in main + */ + MESSAGE("SALOME_PYQT_PyInterp::initPython"); + ASSERT(KERNEL_PYTHON::_gtstate); // initialisation in main + SCRUTE(KERNEL_PYTHON::_gtstate); + _gtstate=KERNEL_PYTHON::_gtstate; + _interp=KERNEL_PYTHON::_interp; +} + bool SALOME_PYQT_PyInterp::initState() { /* diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.h b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.h index 3daf66664..a53ee7264 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.h @@ -38,6 +38,7 @@ public: int run( const char* ); protected: + virtual void initPython(); virtual bool initState(); virtual bool initContext(); }; diff --git a/src/SalomeApp/SalomeApp_PyInterp.cxx b/src/SalomeApp/SalomeApp_PyInterp.cxx index b60117d08..27d520f6f 100755 --- a/src/SalomeApp/SalomeApp_PyInterp.cxx +++ b/src/SalomeApp/SalomeApp_PyInterp.cxx @@ -110,7 +110,7 @@ bool SalomeApp_PyInterp::initContext() */ void SalomeApp_PyInterp::initPython() { - MESSAGE("PyInterp_base::initPython"); + MESSAGE("SalomeApp_PyInterp::initPython"); ASSERT(KERNEL_PYTHON::_gtstate); // initialisation in main SCRUTE(KERNEL_PYTHON::_gtstate); _gtstate=KERNEL_PYTHON::_gtstate;