diff --git a/Source/Engine/Content/Storage/FlaxStorage.cpp b/Source/Engine/Content/Storage/FlaxStorage.cpp index 8dee911e4..4eaea48f8 100644 --- a/Source/Engine/Content/Storage/FlaxStorage.cpp +++ b/Source/Engine/Content/Storage/FlaxStorage.cpp @@ -243,9 +243,9 @@ FlaxStorage::~FlaxStorage() { // Validate if has been disposed ASSERT(IsDisposed()); - CHECK(_chunksLock == 0); - CHECK(_refCount == 0); - CHECK(_isUnloadingData == 0); + CHECK_NO_RETURN(_chunksLock == 0); + CHECK_NO_RETURN(_refCount == 0); + CHECK_NO_RETURN(_isUnloadingData == 0); ASSERT(_chunks.IsEmpty()); #if USE_EDITOR diff --git a/Source/Engine/Platform/Platform.h b/Source/Engine/Platform/Platform.h index e2c6808c9..438cb6602 100644 --- a/Source/Engine/Platform/Platform.h +++ b/Source/Engine/Platform/Platform.h @@ -75,6 +75,12 @@ Platform::CheckFailed(#expression, __FILE__, __LINE__); \ return returnValue; \ } +// Performs a soft check of the expression. Logs the expression failure and continues execution. +#define CHECK_NO_RETURN(expression) \ + if (!(expression)) \ + { \ + Platform::CheckFailed(#expression, __FILE__, __LINE__); \ + } #if ENABLE_ASSERTION // Performs a soft check of the expression. Logs the expression failure and returns from the function call.