Преглед изворни кода

ctkAbstractPythonManager: Clean up PythonQt before finalizing the Python interpreter

This commit moves the call to PythonQt's cleanup function to be before
the call that finalizes the Python interpreter. The interpreter should
still be running during PythonQt::cleanup() so that calls to Py_DECREF
succeed.
Max Smolens пре 10 година
родитељ
комит
77a24f217d
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      Libs/Scripting/Python/Core/ctkAbstractPythonManager.cpp

+ 2 - 1
Libs/Scripting/Python/Core/ctkAbstractPythonManager.cpp

@@ -86,11 +86,12 @@ ctkAbstractPythonManager::ctkAbstractPythonManager(QObject* _parent) : Superclas
 //-----------------------------------------------------------------------------
 ctkAbstractPythonManager::~ctkAbstractPythonManager()
 {
+  PythonQt::cleanup();
+
   if (Py_IsInitialized())
     {
     Py_Finalize();
     }
-  PythonQt::cleanup();
 }
 
 //-----------------------------------------------------------------------------