Fix assertion on engine close due to rare invalid storage object refs count

This commit is contained in:
Wojtek Figat
2021-03-27 19:27:04 +01:00
parent 7de7c8806e
commit 732f74e5c9

View File

@@ -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();
}
}
}