ObjectPool: gracefully handle case if push_back() throws

This commit is contained in:
Guenter Obiltschnig
2016-12-06 00:03:39 +01:00
parent bfaa161c61
commit 9c436860b3

View File

@@ -258,10 +258,16 @@ public:
{
_factory.deactivateObject(pObject);
if (_pool.size() < _capacity)
{
try
{
_pool.push_back(pObject);
return;
}
catch (...)
{
}
}
}
_factory.destroyObject(pObject);
_size--;