Re: Is Apple's singleton sample code correct?
Re: Is Apple's singleton sample code correct?
- Subject: Re: Is Apple's singleton sample code correct?
- From: Dirk Stegemann <email@hidden>
- Date: Sun, 4 Dec 2005 04:06:01 +0200
Hi,
Am 04.12.2005 um 01:11 schrieb Dietmar Planitzer:
On Dec 3, 2005, at 1:19 AM, Shaun Wexler wrote:
On Dec 2, 2005, at 3:24 PM, Dietmar Planitzer wrote:
What is the sound and important technical reason for overriding
the reference counting methods in the case of a singleton ?
To prevent it's accidental deallocation, when no other objects
happen to be retaining it.
(...)
This is a general problem which applies to all kinds of objects, be
they singletons or non-singeltons,
(...)
Following the argumentation of the advocators of the "Overwrite the -
dealloc method to do nothing" approach, this problem doesn't apply to
the singleton objects, because those are not supposed to be ever
deallocated (until finally wiped out of memory automatically on
application termination), and therefore *not* being part of Cocoa's
memory management rules, which apply to all the other mortal objects.
Regards,
Dirk Stegemann
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden