Skip to content

Commit db10972

Browse files
committed
Handle exception
1 parent 74cb8c4 commit db10972

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Client/game_sa/CDynamicPool.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,14 @@ class CDynamicPool
7676
return pool->AllocateItem();
7777
}
7878

79-
return AllocateNewPart()->AllocateItem();
79+
try
80+
{
81+
return AllocateNewPart()->AllocateItem();
82+
}
83+
catch (const std::bad_alloc&)
84+
{
85+
assert(false && "Could not allocate a memory for CDynamicPoolPart");
86+
}
8087
}
8188

8289
void RemoveItem(PoolObjT* item)

0 commit comments

Comments
 (0)