[Top][All Lists]

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

[bug #18804] -[NSURLHandle resourceData] fails to retain & autorelease i

From: Richard Frith-Macdonald
Subject: [bug #18804] -[NSURLHandle resourceData] fails to retain & autorelease its returned value
Date: Wed, 17 Jan 2007 08:37:56 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3

Update of bug #18804 (project gnustep):

              Item Group:                     Bug => Change Request         
                  Status:                    None => Fixed                  
             Open/Closed:                    Open => Closed                 


Follow-up Comment #1:

This is plainly not a bug (since it's legitimate/normal to return ivars whose
life is that of the receiver, and the GNUstep and MacOS-X documentation don't
say that the value will be autoreleased), so I have treated it as a change
request instead.
I've implemented it for consistency.

This behavior is actually an undocumented implementation detail, and can't be
guaranteed in GNUstep-base or Cocoa Foundation.
This means that if an application depends on this implementation detail then
there is a bug in the application ... the general rule for handling objects
returned by methods is that the caller MUST retain the object immediately
before calling any other method which might possibly cause it to be
destroyed.  Assuming that the object will persist as long as the enclosing
autorelease pool persists is an error unless the method is specifically
documented as returning an autoreleased object.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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