Peter Duniho:
>
> I don't have a fundamental objection to ref-counting. It's used
> extensively in COM under Windows, and I've used it in a variety of other
> contexts as well. The problem is ref-counting without well-defined
> rules as to when you've been granted an implicit owner count and when
> you haven't (manual release versus autorelease).
The rules are very well defined.
"You take ownership of an object if you create it using a method whose name
begins with “alloc” or “new” or contains “copy” (for example, alloc,
newObject, or mutableCopy), or if you send it a retain message. You are
responsible for relinquishing ownership of objects you own using release or
autorelease. Any other time you receive an object, you must not release it."
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html
There are some exceptions for bugwards-compatibility, but breaking the rules
doesn't make the rules less well defined. :-)
--
Jens Ayton
Sed quis custodiet ipsos custodes?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden