• 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: Cleaning up a singleton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cleaning up a singleton


  • Subject: Re: Cleaning up a singleton
  • From: Andreas Mayer <email@hidden>
  • Date: Sat, 24 May 2008 08:20:09 +0200


Am 24.05.2008 um 08:07 Uhr schrieb Sebastian Nowicki:

The library requires me to call a function which allocates memory to that global variable, and afterwards call a function which deallocates that memory. My singleton class calls the function to initialise in the init method, but I don't know how to deallocate the memory. [...] How would I handle this?

Um. You don't?

Since all memory is reclaimed when the application quits, deallocating a singleton to free memory is not necessary.

If, for some other reason, you need to act when the application quits, you can register for the NSApplicationWillTerminateNotification notification.


Andreas _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Cleaning up a singleton (From: Sebastian Nowicki <email@hidden>)

  • Prev by Date: Re: Query about Zip command
  • Next by Date: Re: Query about Zip command
  • Previous by thread: Re: Cleaning up a singleton
  • Next by thread: NSURLConnection canHandleRequest: succeeds even with no network
  • Index(es):
    • Date
    • Thread