Re: Destructor and exit()
Re: Destructor and exit()
- Subject: Re: Destructor and exit()
- From: Markus Hitter <email@hidden>
- Date: Fri, 2 Sep 2005 21:17:07 +0200
Am 02.09.2005 um 20:25 schrieb Eric Shepherd:
I have a C++ program that originated on Windows that relies on
objects' destructors being called when exit() is called in order to
save the application's state to disk. However, when built with gcc
3.3 on Mac OS X, the destructors are never getting called.
This is expected for all versions of gcc. I don't know about other
compilers.
Any ideas why this is the case
Less functionality to implement, better performance on application
quit (probably).
and how I can make the destructors get called?
Depends on the GUI framework you use.
Without GUI, try atexit(3).
With Cocoa, implement an NSApplication delegate with the method -
applicationShouldTerminate and/or -applicationWillTerminate.
For others, I dunno.
N.B.: This list is about the usage of Xcode it's self, less about the
languages/frameworks you can program with it. Apple also provides
lists named Cocoa Development, Darwin Development, Carbon
Development, ...
Cheers,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden