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 16:35:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc3) Gecko/20020523

Richard Frith-Macdonald wrote:
Interesting ... GNUstep implements the documented behavior -
retain increments the retain count (by calling NSIncrementExtraReefCount(), release decrements it (by calling NSDecrementExtraRefCountWasZero()), and when it reaches zero dealloc is called.

Well, this is the documented behaviour NSDecrementExtraRefCount*. The full implementation of -release actually isn't documented ?!

So a retain within the dealloc will increment the retain count to 1, the release will decrement it to
zero, and dealloc will get called again.

Exactly.

Presumably MacOS-X actually differs slightly from the documented behavior and does something like ignoring
any retain/release when the retain count is zero?

Hm, I don't yet understand why the libFoundation implementation works (I can retain/release as much as I like). I need to think more about that.

We could change GNUstep to work the same way for compatibility - though I think it would be a little less
efficient when built to user a map table for the extra reference counts.

I'll check the MacOSX implementation in detail this evening ;-)

Greetings
  Helge




reply via email to

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