Skip to content

Commit

Permalink
Merge pull request #1037 from overte-org/fix/bad_weak_ptr
Browse files Browse the repository at this point in the history
Fix unhandled std::bad_weak_ptr
  • Loading branch information
ksuprynowicz authored Jun 20, 2024
2 parents 81f1da9 + 9d8b801 commit fa514bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/script-engine/src/ScriptManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2054,7 +2054,7 @@ void ScriptManager::loadEntityScript(const EntityItemID& entityID, const QString
std::weak_ptr<ScriptManager> weakRef(shared_from_this());
scriptCache->getScriptContents(entityScript,
[this, weakRef, entityScript, entityID](const QString& url, const QString& contents, bool isURL, bool success, const QString& status) {
std::shared_ptr<ScriptManager> strongRef(weakRef);
std::shared_ptr<ScriptManager> strongRef = weakRef.lock();
if (!strongRef) {
qCWarning(scriptengine) << "loadEntityScript.contentAvailable -- ScriptManager was deleted during getScriptContents!!";
return;
Expand Down

0 comments on commit fa514bc

Please sign in to comment.