开发者

Fixing a memory leak

开发者 https://www.devze.com 2022-12-21 06:52 出处:网络
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] autorelea

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

精彩评论

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

关注公众号