fixed memory leak in -zoomByFactor:near:animated:withCallback: (issue 50, issue 52)
Showing
1 changed file
with
3 additions
and
1 deletions
@@ -326,11 +326,13 @@ | @@ -326,11 +326,13 @@ | ||
326 | float nSteps = animTime / stepTime; | 326 | float nSteps = animTime / stepTime; |
327 | float zoomIncr = zoomDelta / nSteps; | 327 | float zoomIncr = zoomDelta / nSteps; |
328 | 328 | ||
329 | + CFDictionaryRef pivotDictionary = CGPointCreateDictionaryRepresentation(pivot); | ||
329 | NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: | 330 | NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: |
330 | [NSNumber numberWithFloat:zoomIncr], @"zoomIncr", | 331 | [NSNumber numberWithFloat:zoomIncr], @"zoomIncr", |
331 | [NSNumber numberWithFloat:targetZoom], @"targetZoom", | 332 | [NSNumber numberWithFloat:targetZoom], @"targetZoom", |
332 | - CGPointCreateDictionaryRepresentation(pivot), @"pivot", | 333 | + pivotDictionary, @"pivot", |
333 | callback, @"callback", nil]; | 334 | callback, @"callback", nil]; |
335 | + CFRelease(pivotDictionary); | ||
334 | [NSTimer scheduledTimerWithTimeInterval:stepTime | 336 | [NSTimer scheduledTimerWithTimeInterval:stepTime |
335 | target:self | 337 | target:self |
336 | selector:@selector(animatedZoomStep:) | 338 | selector:@selector(animatedZoomStep:) |
-
Please register or login to post a comment