History

more safeguards

HifiExperiments committed 5 years ago

Commit 2667af31 parent 3335c0417 files · +94 −73Browse files

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

Unified · Split

interface/src/scripting/DesktopScriptingInterface.cpp+6−1
@@ -99,11 +99,16 @@ void DesktopScriptingInterface::setHUDAlpha(float alpha) { · 98 unmodified lines
99}99}
100 100
101void DesktopScriptingInterface::show(const QString& path, const QString& title) {101void DesktopScriptingInterface::show(const QString& path, const QString& title) {
102 auto offscreenUI = DependencyManager::get<OffscreenUi>();
103 if (!offscreenUI) {
104 return;
105 }
106
102 if (QThread::currentThread() != thread()) {107 if (QThread::currentThread() != thread()) {
103 QMetaObject::invokeMethod(this, "show", Qt::QueuedConnection, Q_ARG(QString, path), Q_ARG(QString, title));108 QMetaObject::invokeMethod(this, "show", Qt::QueuedConnection, Q_ARG(QString, path), Q_ARG(QString, title));
104 return;109 return;
105 }110 }
106 DependencyManager::get<OffscreenUi>()->show(path, title);111 offscreenUI->show(path, title);
107}112}
108 113
109InteractiveWindowPointer DesktopScriptingInterface::createWindow(const QString& sourceUrl, const QVariantMap& properties) {114InteractiveWindowPointer DesktopScriptingInterface::createWindow(const QString& sourceUrl, const QVariantMap& properties) {