Re: Autorelease pool
Re: Autorelease pool
- Subject: Re: Autorelease pool
- From: Dave Carrigan <email@hidden>
- Date: Wed, 7 Oct 2009 15:12:43 -0700
On Oct 7, 2009, at 2:53 PM, Michael Süssner wrote:
NSArray *vPolyArray = [NSArray arrayWithObjects:
[[PolygonShape alloc] initWithNumberOfSides:4
minimumNumberOfSides:3 maximumNumberOfSides:7],
[[PolygonShape alloc] initWithNumberOfSides:6
minimumNumberOfSides:5 maximumNumberOfSides:9],
[[PolygonShape alloc] initWithNumberOfSides:11
minimumNumberOfSides:9 maximumNumberOfSides:12],
nil];
You have 3 memory leaks here.
[vPolyArray release];
You are over-releasing this.
Read and re-read the memory management rules until you start dreaming
about them. Then you will start on the path to enlightenment :-)
--
Dave Carrigan
email@hidden
Seattle, WA, USA
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden