From 1e53972a2ae6caa9e28ecd05bb242709454bd2db Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sun, 17 Mar 2024 16:09:24 +0000 Subject: [PATCH] [*] Harden AuFutures against OOM --- Include/Aurora/Async/AuFutures.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Include/Aurora/Async/AuFutures.hpp b/Include/Aurora/Async/AuFutures.hpp index e25a0650..2e5a44dd 100644 --- a/Include/Aurora/Async/AuFutures.hpp +++ b/Include/Aurora/Async/AuFutures.hpp @@ -43,6 +43,7 @@ public: void OnComplete(CompleteCallback_f callback) { + AU_DEBUG_MEMCRUNCH; AU_LOCK_GUARD(this->mutex); if (this->bComplete) @@ -77,6 +78,7 @@ public: void OnFailure(ErrorCallback_f onFailure) { + AU_DEBUG_MEMCRUNCH; AU_LOCK_GUARD(this->mutex); if (this->bFailed) @@ -112,6 +114,7 @@ public: template> * = nullptr> void Complete(Move_t value) { + AU_DEBUG_MEMCRUNCH; AU_LOCK_GUARD(this->mutex); ExchangeDone(); @@ -385,6 +388,7 @@ struct AuWaterfall : AuEnableSharedFromThis void OnFailure(AuVoidFunc onFailure) { + AU_DEBUG_MEMCRUNCH; AU_LOCK_GUARD(this->mutex); if (this->bDone) @@ -406,6 +410,7 @@ struct AuWaterfall : AuEnableSharedFromThis void OnSuccess(AuVoidFunc onSuccess) { + AU_DEBUG_MEMCRUNCH; AU_LOCK_GUARD(this->mutex); if (this->bDone)