Search code examples
objective-cinstruments

Does the leaks tool in Instruments give false positives?


I have autoreleased objects that I am assigning to synthesized (retain) properties on an object but it is marking them as leaked. Does leaks just sometimes have false positives or am I missing something?


Solution

  • a retain property will overrule an autorelease.

    EDIT for clarity, I don't mean overrule. I mean... it will prevent an autorelease from forcing a dealloc. See comments for all the grimy details.

    you should be manually releasing that property in your dealloc to let autorelease run its course