* ctkSimplePythonShell: Event loop now terminate when SimplePythonShell is closed BUG: AbtractPythonManager - Ensure the interpreter context is properly cleanup STYLE: Remove extra debut statement in ctkPyhtonShell
@@ -14,7 +14,7 @@ int main(int argc, char** argv)
ctkSimplePythonManager pythonManager;
ctkPythonShell shell(&pythonManager);
- shell.setAttribute(Qt::WA_QuitOnClose, false);
+ shell.setAttribute(Qt::WA_QuitOnClose, true);
shell.resize(600, 280);
shell.show();
@@ -84,6 +84,8 @@ ctkAbstractPythonManager::ctkAbstractPythonManager(QObject* _parent) : Superclas
//-----------------------------------------------------------------------------
ctkAbstractPythonManager::~ctkAbstractPythonManager()
{
+ PyThreadState* state = PyThreadState_Get();
+ Py_EndInterpreter(state);
PythonQt::cleanup();
}
@@ -204,7 +204,6 @@ struct ctkPythonShell::pqImplementation
//----------------------------------------------------------------------------
void initializeInteractiveConsole()
- qDebug() << "initializeInteractiveConsole";
// set up the code.InteractiveConsole instance that we'll use.
const char* code =
"import code\n"