• 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: dealloc not beeing called... why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dealloc not beeing called... why?


  • Subject: Re: dealloc not beeing called... why?
  • From: Nathan Day <email@hidden>
  • Date: Wed, 10 Jul 2002 01:14:39 +0930

Although strictly all objects that are retained should be released, some are not, when you application quits instead of the AppKit going through and releasing and eventually deallocating every instance, it just forget about it since the memory of your applications process will be removed when that process terminates (allocating and releasing of memory is contained within this process), this makes quitting an application quicker. Memory leaks are only a problem when it increases over time, like if you keep creating objects which are not released, in some situations there are a fixed number of objects created so it's not a problem, like objects contained within you main nib. This does mean though that if you try to do some other cleaning up in your dealloc method, other than releasing object, it will not work. Instead you will have to either implement the applicationWillTerminate: method in your application delegate or listen for NSApplicationWillTerminateNotification Notification somewhere else.

On Wednesday, July 10, 2002, at 12:04 AM, Development wrote:

OK, but I thought, the OS would care about the deallocation of the object. It has the -dealloc method already built-in and whoever created the instance of my subclasses NSObject after NIB load has to call this -dealloc method eventually, no?!

If not, what's the right time and where's the right place to call the objects -dealloc method, i.e. is there a recommended way to do this? I have to do some clean up before quitting the app...

Maybe to intercept some kind of message?
Better subclass NSApplication instead of NSObject to have better control over app runtime?

tia,
Dirk Stegemann
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: dealloc not beeing called... why? (From: Development <email@hidden>)

  • Prev by Date: Re: Fwd: Apr Dev Tools: Run session aborted: No launchable executable present to run
  • Next by Date: Re: Non-standard Cocoa RTF Unicode encoding?
  • Previous by thread: Re: dealloc not beeing called... why?
  • Next by thread: Re: dealloc not beeing called... why?
  • Index(es):
    • Date
    • Thread