Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 33 files). Show all
Unified · Split
| @@ -1607,14 +1607,14 @@ QVariantMap ScriptEngine::fetchModuleSource(const QString& modulePath, const boo · 1606 unmodified lines | |||
| 1607 | if (!loader->isFinished()) { | 1607 | if (!loader->isFinished()) { |
| 1608 | QTimer monitor; | 1608 | QTimer monitor; |
| 1609 | QEventLoop loop; | 1609 | QEventLoop loop; |
| 1610 | QObject::connect(loader, &BatchLoader::finished, this, [this, &monitor, &loop]{ | 1610 | QObject::connect(loader, &BatchLoader::finished, this, [&monitor, &loop]{ |
| 1611 | monitor.stop(); | 1611 | monitor.stop(); |
| 1612 | loop.quit(); | 1612 | loop.quit(); |
| 1613 | }); | 1613 | }); |
| 1614 | 1614 | ||
| 1615 | // this helps detect the case where stop() is invoked during the download | 1615 | // this helps detect the case where stop() is invoked during the download |
| 1616 | // but not seen in time to abort processing in onload()... | 1616 | // but not seen in time to abort processing in onload()... |
| 1617 | connect(&monitor, &QTimer::timeout, this, [this, &loop, &loader]{ | 1617 | connect(&monitor, &QTimer::timeout, this, [this, &loop]{ |
| 1618 | if (isStopping()) { | 1618 | if (isStopping()) { |
| 1619 | loop.exit(-1); | 1619 | loop.exit(-1); |
| 1620 | } | 1620 | } |
| @@ -2247,7 +2247,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 626 unmodified lines | |||
| 2247 | QTimer timeout; | 2247 | QTimer timeout; |
| 2248 | timeout.setSingleShot(true); | 2248 | timeout.setSingleShot(true); |
| 2249 | timeout.start(SANDBOX_TIMEOUT); | 2249 | timeout.start(SANDBOX_TIMEOUT); |
| 2250 | connect(&timeout, &QTimer::timeout, [&sandbox, SANDBOX_TIMEOUT, scriptOrURL]{ | 2250 | connect(&timeout, &QTimer::timeout, [&sandbox, scriptOrURL]{ |
| 2251 | qCDebug(scriptengine) << "ScriptEngine::entityScriptContentAvailable timeout(" << scriptOrURL << ")"; | 2251 | qCDebug(scriptengine) << "ScriptEngine::entityScriptContentAvailable timeout(" << scriptOrURL << ")"; |
| 2252 | 2252 | ||
| 2253 | // Guard against infinite loops and non-performant code | 2253 | // Guard against infinite loops and non-performant code |