• 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 methods not being called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dealloc methods not being called?


  • Subject: Re: dealloc methods not being called?
  • From: John Stiles <email@hidden>
  • Date: Fri, 21 Mar 2008 14:23:31 -0700

AppKit does an optimization where at app shutdown time, it stops dealloc'ing things.

It does make app quitting faster, but it means that if your deallocs have side effects, the side effects will never occur. It also makes leak tracking difficult if you try to do a full-on leak check at application shutdown (something which many C++ apps do, but I've never seen done in ObjC).


Randall Meadows wrote:
I'm trying to do some cleanup work when my app terminates*. I have the appropriate code to do said cleanup in one of my dealloc methods. I'm finding that when I quit the app (cmd-Q), NONE of my dealloc methods are being called (I have breakpoints set of every one of them, and not a single one is being called).

Now, I've implemented NSApplication's -applicationWillTerminate: delegate method, and thankfully it *is* being called, so I s'pose I can do what I need to do there, but...why aren't any of the dealloc methods being hit?


Thanks! randy

* - One of my objects holds onto a connection to an external camera; without properly closing this connection, the camera cannot be operated manually without first disconnecting it from the computer, so I want to be nice and clean things up.
_______________________________________________


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
_______________________________________________

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


  • Follow-Ups:
    • Re: dealloc methods not being called?
      • From: Nick Zitzmann <email@hidden>
References: 
 >dealloc methods not being called? (From: Randall Meadows <email@hidden>)

  • Prev by Date: Re: NIB files on 10.1
  • Next by Date: Re: dealloc methods not being called?
  • Previous by thread: dealloc methods not being called?
  • Next by thread: Re: dealloc methods not being called?
  • Index(es):
    • Date
    • Thread