Reputation:
Here is a scenario that appears to trick Leaks:
That's it. The subviews are not released, but Leaks will not see them either.
Has anyone else seen this?
Note: The solution to this problem is to removeFromSuperview anything attached to v.
Thanks.
Upvotes: 0
Views: 78
Reputation: 3383
You need to read up on the memory guidelines.
You have done your part of the memory management by autoreleasing the UIViews you created, and you have transferred the ownership of them to UIView v.
Edit
After reading your comments it seems like they are actually not getting released, which could be to a circular reference. Are you sure nothing else is retaining the view? How are you instantiating them?
Upvotes: 1
Reputation: 41005
What makes you think that they aren't released?
It sounds like your retains and releases are balanced, so they should be released correctly. What may be confusing you is that because they are autoreleased, they won't be released right away but will instead be released 1/60th second later when the autorelease pool is flushed.
In case it helps clarify things: Views automatically retain subviews when they are added, and release them when they are themselves released (just like adding items to an array).
Upvotes: 1