Is release without prior retain dangerous?

Posted by BankStrong on Stack Overflow See other posts from Stack Overflow or by BankStrong
Published on 2010-04-13T15:34:13Z Indexed on 2010/04/13 15:43 UTC
Read the original article Hit count: 377

Filed under:
|

I have some code which I think has extra release statements.

  1. Is the code incorrect?
  2. What is the end result?

I don't understand memory management well yet - even after reading lots of articles and stackoverflow answers. Thanks for straightening me out.

NSMutableArray *points = [NSMutableArray new];
for (Segment *s in currentWorkout.segments) {
 [points addObjectsFromArray:[s.track locationPoints]];
}
[routeMap update:points];
[points release];

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c