History

threadsafe setRenderMethod

SamGondelman committed 7 years ago

Commit db813fa1 parent 451c52f2 files · +6 −7Browse files

Showing the changes to interface/src/scripting/RenderScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/scripting/RenderScriptingInterface.cpp+5−0
@@ -24,6 +24,11 @@ QString RenderScriptingInterface::getRenderMethod() { · 23 unmodified lines
2424 }
2525
2626 void RenderScriptingInterface::setRenderMethod(const QString& renderMethod) {
27+ if (QThread::currentThread() != thread()) {
28+ QMetaObject::invokeMethod(this, "setRenderMethod", Q_ARG(const QString&, renderMethod));
29+ return;
30+ }
31+
2732 auto config = dynamic_cast<task::SwitchConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch"));
2833 if (config) {
2934 if (renderMethod == DEFERRED) {