History

fix implicit this

RTUnreal committed 1 year ago

Commit 86c5f2c1 parent 611faa942 files · +134 −135Browse files

Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 42 files). Show all

Unified · Split

libraries/script-engine/src/ScriptManager.cpp+4−4
@@ -711,7 +711,7 @@ bool externalResourceBucketFromScriptValue(const ScriptValue& object, ExternalRe · 710 unmodified lines
711711
712712 void ScriptManager::resetModuleCache(bool deleteScriptCache) {
713713 if (QThread::currentThread() != thread()) {
714− executeOnScriptThread([=]() { resetModuleCache(deleteScriptCache); });
714+ executeOnScriptThread([=, this]() { resetModuleCache(deleteScriptCache); });
715715 return;
716716 }
717717 auto jsRequire = _engine->globalObject().property("Script").property("require");
@@ -1528,7 +1528,7 @@ QVariantMap ScriptManager::fetchModuleSource(const QString& modulePath, const bo · 810 unmodified lines
15281528 QVariantMap req;
15291529 qCDebug(scriptengine_module) << "require.fetchModuleSource: " << QUrl(modulePath).fileName() << QThread::currentThread();
15301530
1531− auto onload = [=, &req](const UrlMap& data, const UrlMap& _status) {
1531+ auto onload = [=, this, &req](const UrlMap& data, const UrlMap& _status) {
15321532 auto url = modulePath;
15331533 auto status = _status[url];
15341534 auto contents = data[url];
@@ -1780,7 +1780,7 @@ void ScriptManager::include(const QStringList& includeFiles, const ScriptValue& · 245 unmodified lines
17801780 EntityItemID capturedEntityIdentifier = currentEntityIdentifier;
17811781 QUrl capturedSandboxURL = currentSandboxURL;
17821782
1783− auto evaluateScripts = [=](const QMap<QUrl, QString>& data, const QMap<QUrl, QString>& status) {
1783+ auto evaluateScripts = [=, this](const QMap<QUrl, QString>& data, const QMap<QUrl, QString>& status) {
17841784 auto parentURL = _parentURL;
17851785 for (QUrl url : urls) {
17861786 QString contents = data[url];
@@ -2081,7 +2081,7 @@ void ScriptManager::loadEntityScript(const EntityItemID& entityID, const QString · 294 unmodified lines
20812081 #endif
20822082 return;
20832083 }
2084− executeOnScriptThread([=]{
2084+ executeOnScriptThread([=, this]{
20852085 #ifdef DEBUG_ENTITY_STATES
20862086 qCDebug(scriptengine) << "loadEntityScript.contentAvailable" << status << entityID.toString();
20872087 #endif