// March 08, 2002: moved the assignment to pTrackerArray in SetLongevity to fix

//      exception safety issue. Credit due to Kari Hoijarvi


git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@13 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
aandrei 2002-03-08 21:28:12 +00:00
parent 783d4e4bc5
commit 48bd335289

View file

@ -106,12 +106,12 @@ namespace Loki
sizeof(T) * (elements + 1)));
if (!pNewArray) throw std::bad_alloc();
LifetimeTracker* p = new ConcreteLifetimeTracker<T, Destroyer>(
pDynObject, longevity, d);
// Delayed assignment for exception safety
pTrackerArray = pNewArray;
LifetimeTracker* p = new ConcreteLifetimeTracker<T, Destroyer>(
pDynObject, longevity, d);
// Insert a pointer to the object into the queue
TrackerArray pos = std::upper_bound(
pTrackerArray,
@ -439,6 +439,8 @@ namespace Loki
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
// January 08, 2002: Fixed bug in call to realloc - credit due to Nigel Gent and
// Eike Petersen
// March 08, 2002: moved the assignment to pTrackerArray in SetLongevity to fix
// exception safety issue. Credit due to Kari Hoijarvi
////////////////////////////////////////////////////////////////////////////////
#endif // SINGLETON_INC_