home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13332 < prev    next >
Encoding:
Text File  |  1992-09-07  |  1.2 KB  |  30 lines

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