Terminating an application
Jarrett Billingsley
kb3ctd2 at yahoo.com
Wed Sep 12 15:43:01 PDT 2007
"Bill Baxter" <dnewsgroup at billbaxter.com> wrote in message
news:fc9oc2$2dsc$1 at digitalmars.com...
> exit() is defined in std.c.stdlib. Selective import is good to avoid
> polluting your namespace with all the other cruft in stdlib:
Sadly, exit() will not unwind the stack, calling scope blocks and destroying
scope instances. It also will not call any of the runtime cleanup functions
(calling module dtors, closing the GC, anything else the RT wants to do)
without explicitly telling it to with atexit(). So, it's not a very robust
situation for the general case. I'd be _very_ interested how one could
solve this without throwing an exception that you catch in main. Perhaps
it's another runtime function that is necessary, one that'll unwind the
stack but without an exception.
More information about the Digitalmars-d
mailing list