gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sending notifications in -dealloc


From: Helge Hess
Subject: Re: sending notifications in -dealloc
Date: Fri, 31 May 2002 17:21:02 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc3) Gecko/20020523

Richard Frith-Macdonald wrote:
Perhaps NSDecrementExtraRefCountWasZero() and NSIncrementExtraRefCount() should simply not operate once the extra ref count goes to (unsigned)-1 (with the former returning NO) ?

Hm, I'm unsure about that. I'll check MacOSX. Even though I don't remember that I have written this somewhere, I could imagine code which essentially does that:

- (void)dealloc {
  if ([self shouldCache]) {
    [MyCache addObject:self];
    return;
  }
  [super dealloc];
}

That is, the reference count really is raised up again and the deallocation is canceled. I'm aware that this is very dangerous (especially with subclassing) ...

I'll check MacOSX ...

Greetings
  Helge




reply via email to

[Prev in Thread] Current Thread [Next in Thread]