Should images returned from NSTableView's dragImageForRowsWithIndexes be autoreleased?

Jim Correia jim.correia at pobox.com
Mon Sep 24 11:26:57 PDT 2007


On Sep 24, 2007, at 2: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.

You should assume that, unless an exception is specifically called  
out, that the standard object ownership rules apply.

Jim



More information about the MacOSX-dev mailing list