Should images returned from NSTableView's
dragImageForRowsWithIndexes be autoreleased?
Fritz Anderson
fritza at manoverboard.org
Mon Sep 24 11:32:55 PDT 2007
On 24 Sep 2007, at 1:20 PM, Michael Dupuis wrote:
> I have a table subclass that implements
> dragImageForRowsWithIndexes:::: and have random
> reports of a crash while in the drag loop code (not my
> own) that makes me wonder about the images that are
> created in the implementation: should images alloc'd
> in this call be "leaked" i.e. not released, not
> autoreleased, or should they be autoreleased? Right
> now I autorelease them, and I can't really find
> anything in the documentation or the list that
> specifies the actual image retention explicitly.
By the rules of object ownership for memory management (which I won't
fully summarize here), you must not release or autorelease any object
returned from a method not containing "alloc", "new", or "copy" in its
name.
-- F
More information about the MacOSX-dev
mailing list