home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: Destructors and exit()
- Message-ID: <1992Sep5.153309.19401@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Sep3.220301.16983@murdoch.acc.Virginia.EDU> <rmartin.715615353@thor>
- Date: Sat, 5 Sep 1992 15:33:09 GMT
- Lines: 19
-
- rmartin@thor.Rational.COM (Bob Martin) writes:
-
- |The destructors for static objects should be invoked when you call
- |exit. However the destructors for objects which are declared as
- |'auto' variables (on the stack) in the function which calls exit,
- |probably will not get invoked...
- |... I say probably, because a clever compiler might be
- |able to figure out that, upon exit, the enclosing stack frames should
- |be destroyed.
-
- Auto objects are NOT destroyed when exit() is called, only static
- objects which have been constructed. My copy of the ARM is not handy,
- and I don't remember whether the bit about auto objects is clearly
- stated there. It is made explicit in the C++ Committee Working Paper,
- and it is very safe to assume the final Standard will say that.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
- Vice Chair, ANSI C++ Committee, X3J16
-