On 29/12/2011 19:09, Jacob Carlborg wrote:
<snip excessive quote>
Could druntime hook up on the atexit function to run destructors and similar 
when the
program exits?

I'm not sure. Maybe it could be called upon to run static destructors and destruct heap-allocated objects. But in order to call scope guards and RAII, it would need to unwind the call stack, which could get complicated if you're trying to do it from within a function.

It's much simpler not to use exit() and throw a custom exception instead.

Stewart.

Reply via email to