Skip to content

Commit

Permalink
ObjectPool: gracefully handle case if push_back() throws
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Dec 5, 2016
1 parent bfaa161 commit 9c43686
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Foundation/include/Poco/ObjectPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,14 @@ class ObjectPool
_factory.deactivateObject(pObject);
if (_pool.size() < _capacity)
{
_pool.push_back(pObject);
return;
try
{
_pool.push_back(pObject);
return;
}
catch (...)
{
}
}
}
_factory.destroyObject(pObject);
Expand Down

0 comments on commit 9c43686

Please sign in to comment.