Fix very rare race condition when waiting for an asset to load

This commit is contained in:
Wojtek Figat
2026-02-03 23:33:09 +01:00
parent 9a44902949
commit 4d447b7544

View File

@@ -487,6 +487,8 @@ bool Asset::WaitForLoaded(double timeoutInMilliseconds) const
const auto loadingTask = (ContentLoadTask*)Platform::AtomicRead(&_loadingTask);
if (loadingTask == nullptr)
{
if (IsLoaded())
return false;
LOG(Warning, "WaitForLoaded asset \'{0}\' failed. No loading task attached and asset is not loaded.", ToString());
return true;
}