Salome HOME
Merge branch 'origin/akl/single_desktop'
[modules/gui.git] / src / SALOME_PYQT / SALOME_PYQT_GUILight / SALOME_PYQT_ModuleLight.cxx
index 88602237702edce212cf379776796a6e31c87001..7b94636dbe4771bbd69aebc4e15ed76d2eb081bf 100644 (file)
 // Py_ssize_t for old Pythons
 // This code is as recommended by"
 // http://www.python.org/dev/peps/pep-0353/#conversion-guidelines
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-# define PY_SSIZE_T_MAX INT_MAX
-# define PY_SSIZE_T_MIN INT_MIN
-#endif
+//#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+//typedef int Py_ssize_t;
+//# define PY_SSIZE_T_MAX INT_MAX
+//# define PY_SSIZE_T_MIN INT_MIN
+//#endif
 
 //
 // NB: Python requests.
@@ -83,21 +83,8 @@ extern "C"
 
     // make initialization only once (see comment above) !
     if ( !alreadyInitialized ) {
-      static PyThreadState* gtstate = 0;
-#ifndef GUI_DISABLE_CORBA
-      if ( SUIT_PYTHON::initialized )
-        gtstate = SUIT_PYTHON::_gtstate;
-      else
-        gtstate = KERNEL_PYTHON::_gtstate;
-#else
-      gtstate = SUIT_PYTHON::_gtstate;
-#endif
-      PyEval_RestoreThread( gtstate );
-
+      PyLockWrapper lck; // GIL acquisition
       INIT_FUNCTION();
-
-      PyEval_ReleaseThread( gtstate );
-
       alreadyInitialized = !alreadyInitialized;
     }