• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Destructor and exit()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Destructor and exit()
      • From: "Alexey Proskuryakov" <email@hidden>
    • Re: Destructor and exit()
      • From: "Oliver" <email@hidden>
References: 
 >Destructor and exit() (From: Eric Shepherd <email@hidden>)

  • Prev by Date: Re: .xcconfig
  • Next by Date: Re: Xcode Events for External Editors
  • Previous by thread: Destructor and exit()
  • Next by thread: Re: Destructor and exit()
  • Index(es):
    • Date
    • Thread