Skip to content

Commit

Permalink
Handle exception
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Feb 2, 2025
1 parent 74cb8c4 commit db10972
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Client/game_sa/CDynamicPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit db10972

Please sign in to comment.