Re: dealloc of App Contoller never gets called
Re: dealloc of App Contoller never gets called
- Subject: Re: dealloc of App Contoller never gets called
- From: j o a r <email@hidden>
- Date: Fri, 21 Nov 2003 19:43:45 +0100
Feature.
When the application is terminated there is no reason to waste time
deallocating each and every object separately. All memory used by the
application will be cleaned up and reclaimed by the OS in any case. You
cannot leak memory after your application is quit.
You don't need to bother with deallocating static / singleton objects
that will live for the duration of the application. You might still
want to create dealloc methods for these classes, because you might
change how they are used and in that case you might forget to add
dealloc. It's also good practice to always be symmetric with your
retain / release. If you always "do the right thing" it will become
second nature and you will make fewer mistakes over all. That dealloc
is not called in some cases, like this one, is not something that you
need to think about.
This topic has been talked about a lot of times, if you were to check
the list archives.
j o a r
On 2003-11-21, at 18.27, Michael Monscheuer wrote:
>
I am using some kind of application controller to receive messages of
>
menu items of applications' main menu and store some private instance
>
variables within app controller, which i tried to release within
>
-dealloc.
>
Nothing special so far.
>
>
I found a surprisingly behaviour: As application controller is
>
instanciated using the NIB file stuff, i did not expect any problem.
>
But: -dealloc of application controller *never* gets called!
>
Because of this, my application may now have a memory leak, cause app
>
controllers' private stuff never gets released.
>
>
OK, I could release private stuff within a delegate method (e.g.
>
applicationShouldTerminate:). But I am wondering why dealloc never
>
gets called...
>
>
Bug or Feature? ;-)
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.