diff --git a/Singleton.h b/Singleton.h index fb6877e..e0d86bc 100644 --- a/Singleton.h +++ b/Singleton.h @@ -8,13 +8,11 @@ // purpose is hereby granted without fee, provided that the above copyright // notice appear in all copies and that both that copyright notice and this // permission notice appear in supporting documentation. -// The author or Addison-Welsey Longman make no representations about the +// The author or Addison-Wesley Longman make no representations about the // suitability of this software for any purpose. It is provided "as is" // without express or implied warranty. //////////////////////////////////////////////////////////////////////////////// -// Last update: June 20, 2001 - #ifndef SINGLETON_INC_ #define SINGLETON_INC_ @@ -104,7 +102,8 @@ namespace Loki using namespace Private; TrackerArray pNewArray = static_cast( - std::realloc(pTrackerArray, elements + 1)); + std::realloc(pTrackerArray, + sizeof(T) * (elements + 1))); if (!pNewArray) throw std::bad_alloc(); LifetimeTracker* p = new ConcreteLifetimeTracker( @@ -438,6 +437,8 @@ namespace Loki // Change log: // May 21, 2001: Correct the volatile qualifier - credit due to Darin Adler // 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 //////////////////////////////////////////////////////////////////////////////// #endif // SINGLETON_INC_