Fix a threading related crash in python plugin param handling

This commit is contained in:
Michael Zanetti 2021-05-11 16:34:36 +02:00
parent be68d925be
commit 2b9b8cf725

View File

@ -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);