Make init call for python plugins blocking

We don't want to run setupThing() before init() is completed.
This also matches with how C++ plugins work.

Fixes #598
This commit is contained in:
Michael Zanetti 2022-11-09 15:12:18 +01:00
parent 8367f60886
commit a7e1ffca1f

View File

@ -441,6 +441,13 @@ void PythonIntegrationPlugin::init()
m_mutex.unlock();
callPluginFunction("init");
// Waiting for the init to finish. In case a plugin needs to do some more stuff in init we don't
// want to run setupThing() before the init finishes.
if (m_runningTasks.values().contains("init")) {
QFutureWatcher<void> *watcher = m_runningTasks.key("init");
watcher->waitForFinished();
}
}
void PythonIntegrationPlugin::startMonitoringAutoThings()