Merge remote-tracking branch 'origin/master' into 1.2
This commit is contained in:
@@ -408,16 +408,20 @@ Asset* Content::LoadAsync(const StringView& path, MClass* type)
|
||||
|
||||
Asset* Content::LoadAsync(const StringView& path, const ScriptingTypeHandle& type)
|
||||
{
|
||||
// Ensure path is in a valid format
|
||||
String pathNorm(path);
|
||||
FileSystem::NormalizePath(pathNorm);
|
||||
|
||||
#if USE_EDITOR
|
||||
if (!FileSystem::FileExists(path))
|
||||
if (!FileSystem::FileExists(pathNorm))
|
||||
{
|
||||
LOG(Error, "Missing file \'{0}\'", path);
|
||||
LOG(Error, "Missing file \'{0}\'", pathNorm);
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
AssetInfo assetInfo;
|
||||
if (GetAssetInfo(path, assetInfo))
|
||||
if (GetAssetInfo(pathNorm, assetInfo))
|
||||
{
|
||||
return LoadAsync(assetInfo.ID, type);
|
||||
}
|
||||
|
||||
@@ -194,13 +194,13 @@ void FlaxStorage::AddRef()
|
||||
|
||||
void FlaxStorage::RemoveRef()
|
||||
{
|
||||
ASSERT(_refCount > 0);
|
||||
|
||||
_refCount--;
|
||||
|
||||
if (_refCount == 0)
|
||||
if (_refCount > 0)
|
||||
{
|
||||
_lastRefLostTime = DateTime::NowUTC();
|
||||
_refCount--;
|
||||
if (_refCount == 0)
|
||||
{
|
||||
_lastRefLostTime = DateTime::NowUTC();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user