From 24654e5b02abb0cca7ca09babd9b4e5f841f6860 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 2 Jun 2026 15:54:00 +0200 Subject: [PATCH] Add `CHECK_NO_RETURN` for checks in code that should continue function execution --- Source/Engine/Content/Storage/FlaxStorage.cpp | 6 +++--- Source/Engine/Platform/Platform.h | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) 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.