On 10/01/2010, at 12:15 PM, Mr. Gecko wrote: > Hello, I'm going through leak checking and it seems that a if statement is > causing a leak that's 32 Bytes big. My if statement is > > if (connections==nil) { > connections = [[NSMutableArray new] retain]; > } > > It says that if (connections==nil) is leaking 32 bytes which I have no idea > how that could be possible. Yes I'm releasing connections after I'm done > using it. > Should I just ignore this? Thanks,
+new is equivalent to [[alloc] init], so you are retaining twice. So releasing just once is a leak. You don't need the -retain here. --Graham _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com