[Insight-developers] VC++ new and bad_alloc exception

Luis Ibanez luis . ibanez at kitware . com
Sat, 01 Jun 2002 22:43:25 -0400


Hi,

Just for the record:

The implementation of "new" on VC++ doesn't throw
(as it should) a bad_alloc exception when it fails
to allocate the requested amount of memory:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q167733

Microsoft recomends to replace the default error handler routine
with a customized one that will throw the exception for you  :-)

We may want to add this in our itkWin32.h header and/or
somewhere in the itk Factories...


    Luis