mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 10:32:56 +01:00
ObjectPool: gracefully handle case if push_back() throws
This commit is contained in:
@@ -258,10 +258,16 @@ public:
|
||||
{
|
||||
_factory.deactivateObject(pObject);
|
||||
if (_pool.size() < _capacity)
|
||||
{
|
||||
try
|
||||
{
|
||||
_pool.push_back(pObject);
|
||||
return;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
_factory.destroyObject(pObject);
|
||||
_size--;
|
||||
|
||||
Reference in New Issue
Block a user