The new will return NULL when ever a fail to alloc the memory and typically
if your not catching this with a try/catch block or simple if Pointer = null
test then your app may run until you use the pointer  ( or it may not simply
die) or you have bad allocs set to throw an exception in your compiler

Typically in scenegraph a try and catch blocks are rearly used due to the
over head they can introduce, so you paying Peter to rob Paul sort of thing,
your shooting for speed and hit a bad alloc typically means you  process/app
is doomed at that point ( not always but mostly)



Best Regards


Gordon

__________________________________________________________
Gordon Tomlinson
Email  : gordon.tomlinson @ overwatch.com
YIM/AIM: Gordon3dBrit
MSN IM : Gordon3dBrit @ 3dSceneGraph.com

__________________________________________________________
Telephone (Cell): (+1) 214-477-8914
Telephone (Work): (+1) 703-437-7651

"Self defence is not a function of learning tricks
but is a function of how quickly and intensely one
can arouse one's instinct for survival"
- Master Tambo Tetsura

  -----Original Message-----
  From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bradford, Chase
  Sent: Thursday, March 22, 2007 12:49 PM
  To: osg users
  Subject: [osg-users] bad_alloc in DatabasePager thread


  Hi Everyone,



  I'm trying to find out what happens when the new operator fails in a
reader plugin due to insufficient memory.  I don't see any catches for
std::bad_alloc, or std::exception even, so if something like that happens,
will the call stack unwind until DatabasePager::run() is left?  I'm assuming
that there are some guards against a failure like that, but I don't see any,
and I'm worried that it might cause problems for us given the size of the
scenegraph we are trying to load.



  Thanks,

  Chase
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to