From db109721bdb58f4d3be0b0ffd8a5ccd6e1199d26 Mon Sep 17 00:00:00 2001 From: Uladzislau Nikalayevich Date: Sun, 2 Feb 2025 17:26:57 +0300 Subject: [PATCH] Handle exception --- Client/game_sa/CDynamicPool.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Client/game_sa/CDynamicPool.h b/Client/game_sa/CDynamicPool.h index 1f12deca6b..ac2380e316 100644 --- a/Client/game_sa/CDynamicPool.h +++ b/Client/game_sa/CDynamicPool.h @@ -76,7 +76,14 @@ class CDynamicPool return pool->AllocateItem(); } - return AllocateNewPart()->AllocateItem(); + try + { + return AllocateNewPart()->AllocateItem(); + } + catch (const std::bad_alloc&) + { + assert(false && "Could not allocate a memory for CDynamicPoolPart"); + } } void RemoveItem(PoolObjT* item)