Merge pull request #428 from aws-lumberyard-dev/scripting/fix_lua_clear_cache

Scripting/fix lua clear cache
This commit is contained in:
Luis Sempé
2021-04-29 12:05:20 -07:00
committed by GitHub
@@ -699,6 +699,10 @@ Data::AssetHandler::LoadResult ScriptSystemComponent::LoadAssetData(
script->m_scriptBuffer.resize(scriptDataLength);
stream->Read(scriptDataLength, script->m_scriptBuffer.data());
// Clear cached references in the event of a successful load. This function has to be queued on
// AssetBus where NotifyAssetReloaded is also queued, to ensure its execution before NotifyAssetReloaded
Data::AssetBus::QueueFunction(&ScriptSystemComponent::ClearAssetReferences, this, asset.GetId());
return Data::AssetHandler::LoadResult::LoadComplete;
}