mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 10:09:36 +02:00
ObjectPool: gracefully handle case if push_back() throws
This commit is contained in:
@@ -259,8 +259,14 @@ public:
|
||||
_factory.deactivateObject(pObject);
|
||||
if (_pool.size() < _capacity)
|
||||
{
|
||||
_pool.push_back(pObject);
|
||||
return;
|
||||
try
|
||||
{
|
||||
_pool.push_back(pObject);
|
||||
return;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
_factory.destroyObject(pObject);
|
||||
|
||||
Reference in New Issue
Block a user