Commit c59576ea authored by Mathieu Westphal's avatar Mathieu Westphal
Browse files

correction thx to bboeckel && jpouderoux

parent 8eb50dd2
......@@ -142,11 +142,9 @@ public:
vtkPythonScopeGilEnsurer(bool force = false)
{
#ifdef VTK_PYTHON_FULL_THREADSAFE
this->Force = force;
this->Force = true;
#else
this->Force = force;
force = true;
#endif
this->Force = force;
if (this->Force)
{
this->State = PyGILState_Ensure();
......
......@@ -143,14 +143,11 @@ bool vtkPythonInterpreter::Initialize(int initsigs /*=0*/)
if (!vtkPythonInterpreter::InitializedOnce)
{
#ifndef VTK_NO_PYTHON_THREADS
int threadInit = PyEval_ThreadsInitialized();
PyEval_InitThreads(); // safe to call this multiple time
#endif
vtkPythonInterpreter::InitializedOnce = true;
#ifndef VTK_NO_PYTHON_THREADS
int threadInit = PyEval_ThreadsInitialized();
PyEval_InitThreads(); // safe to call this multiple time
if(!threadInit)
{
PyEval_SaveThread(); // release GIL
......
......@@ -42,10 +42,6 @@ vtkSmartPyObject::~vtkSmartPyObject()
vtkPythonScopeGilEnsurer gilEnsurer;
Py_XDECREF(this->Object);
}
else
{
Py_XDECREF(this->Object);
}
}
//--------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment