浏览代码

BUG: AbtractPythonManager - Ensure the interpreter context is properly cleanup

Doing so should avoid unwanted memory leaks
Jean-Christophe Fillion-Robin 14 年之前
父节点
当前提交
4da9f27434
共有 1 个文件被更改,包括 2 次插入0 次删除
  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();
 }