diff --git a/scripting/python_scripter.cc b/scripting/python_scripter.cc --- a/scripting/python_scripter.cc +++ b/scripting/python_scripter.cc @@ -427,8 +427,14 @@ PythonScripter::~PythonScripter() { PyErr_Clear(); - Py_Finalize(); + /* + * Franco: + * + * 'delete' line moved up before the Py_Finalize() call + * see bug https://bugs.kde.org/show_bug.cgi?id=416037 + */ delete d; + Py_FinalizeEx(); } class CompiledPythonScript::Private