Fixing a memory leak
I've ran Build and Analyze on my XML parsing code and found out the following:
(source: skitch.com)How could I开发者_运维问答 fix it?
[channelListing addObject:[[channelListingItem copy] autorelease]];
You need to release the copy of channelListingItem
. As you're passing it to the channelListing
, you can just autorelease
it as it will be "owned" by that mutable collection.
you need to release it as said, the channelListingItem is retaining it.
精彩评论