From 2b9b8cf725bea8e34d18f825a932cd6bd9d10657 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 11 May 2021 16:34:36 +0200 Subject: [PATCH] Fix a threading related crash in python plugin param handling --- libnymea-core/integrations/pythonintegrationplugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libnymea-core/integrations/pythonintegrationplugin.cpp b/libnymea-core/integrations/pythonintegrationplugin.cpp index 1a4ad02e..3bdedb41 100644 --- a/libnymea-core/integrations/pythonintegrationplugin.cpp +++ b/libnymea-core/integrations/pythonintegrationplugin.cpp @@ -415,8 +415,10 @@ bool PythonIntegrationPlugin::loadScript(const QString &scriptFile) m_mutex.unlock(); // And call the handler - if any + PyEval_RestoreThread(m_threadState); PyObject *pyParamTypeId = PyUnicode_FromString(paramTypeId.toString().toUtf8()); PyObject *pyValue = QVariantToPyObject(value); + PyEval_ReleaseThread(m_threadState); callPluginFunction("configValueChanged", pyParamTypeId, pyValue); Py_DECREF(pyParamTypeId); Py_DECREF(pyValue);