]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Update executive version
authorabd <abd@opencascade.com>
Fri, 31 Mar 2006 10:37:00 +0000 (10:37 +0000)
committerabd <abd@opencascade.com>
Fri, 31 Mar 2006 10:37:00 +0000 (10:37 +0000)
Temprorary fix python of calls

src/Container/Container_i.cxx

index 82f63facde0e884d90ed481fa43866437201ab0c..a35b806c0cd94f859fd9fae94fd1f57ebcabb383 100644 (file)
@@ -173,12 +173,20 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb,
 
       if (!_isSupervContainer)
        {
-         Py_ACQUIRE_NEW_THREAD;
+         //Py_ACQUIRE_NEW_THREAD;
+    PyEval_AcquireLock();
+    /* It should not be possible for more than one thread state
+            to be used for a thread.*/
+    PyThreadState *myTstate = PyGILState_GetThisThreadState();
+    // if no thread state defined
+    if ( !myTstate ) myTstate = PyThreadState_New(KERNEL_PYTHON::_interp);
+    PyThreadState *myoldTstate = PyThreadState_Swap(myTstate);
 #ifdef WNT
          // mpv: this is temporary solution: there is a unregular crash if not
-         Sleep(2000);
-         PyRun_SimpleString("import sys\n");
-         // first element is the path to Registry.dll, but it's wrong
+         //Sleep(2000);
+         //
+    // first element is the path to Registry.dll, but it's wrong
+    PyRun_SimpleString("import sys\n");
          PyRun_SimpleString("sys.path = sys.path[1:]\n");
 #endif
          PyRun_SimpleString("import SALOME_Container\n");