Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: How do I call destructors on ^C in TC++? Message-ID: <751@taumet.com> Date: 27 May 91 15:46:45 GMT References: <1991May24.045847.24401@colorado.edu> <1991May27.024810.2300@minyos.xx.rmit.oz.au> Organization: Taumetric Corporation, San Diego Lines: 14 s892992@minyos.xx.rmit.oz.au (Kendall Bennett) writes: | I am pretty sure that if you call the exit() standard library function it |calls the destructors for any AUTO variables, that is any instances that have |been allocated on the stack. If the class instance was allocted in the heap, |then it is up to the program to delete it - so I don't know how you would |handle this one. No, exit() will not call destructors for auto objects, since the language definition does not require that sort of bookkeeping. Destructors only for static objects only will be called when a program terminates via exit(). -- Steve Clamage, TauMetric Corp, steve@taumet.com