Ver código fonte

BUG: AbtractPythonManager - Ensure the interpreter context is properly cleanup

Doing so should avoid unwanted memory leaks
Jean-Christophe Fillion-Robin 14 anos atrás
pai
commit
4da9f27434

+ 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();
 }