Explorar o código

BUG: AbtractPythonManager - Ensure the interpreter context is properly cleanup

Doing so should avoid unwanted memory leaks
Jean-Christophe Fillion-Robin %!s(int64=15) %!d(string=hai) anos
pai
achega
4da9f27434
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      Libs/Scripting/Python/Core/ctkAbstractPythonManager.cpp

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

@@ -77,6 +77,8 @@ ctkAbstractPythonManager::ctkAbstractPythonManager(QObject* _parent) : Superclas
 //-----------------------------------------------------------------------------
 ctkAbstractPythonManager::~ctkAbstractPythonManager()
 {
+  PyThreadState* state = PyThreadState_Get();
+  Py_EndInterpreter(state);
   PythonQt::cleanup();
 }