开发者

Fixing a memory leak

I've ran Build and Analyze on my XML parsing code and found out the following:

Fixing a memory leak

(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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜