Permalink
Browse files

fixed crash with big photo libraries

  • Loading branch information...
1 parent 0fd4a5a commit 3db0ddae03913ff589c5d13aa738e285d0f9dee4 @nst committed Dec 5, 2009
View
Binary file not shown.
@@ -56,12 +56,19 @@ - (void)loadData {
self.contentsDictionaries = [NSMutableArray array];
self.annotations = [NSMutableArray array];
+
- NSEnumerator *e = [[self jpgPaths] reverseObjectEnumerator];
+ NSEnumerator *e = [[[self jpgPaths] reverseObjectEnumerator] init];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
NSString *s = nil;
while(s = [e nextObject]) {
+ [pool release];
+ pool = [[NSAutoreleasePool alloc] init];
+
CLLocationCoordinate2D coord = [UIImage coordinatesOfImageAtPath:s];
if(coord.latitude == 0.0 && coord.longitude == 0.0) continue;
+
NSNumber *lat = [NSNumber numberWithDouble:coord.latitude];
NSNumber *lon = [NSNumber numberWithDouble:coord.longitude];
@@ -83,6 +90,9 @@ - (void)loadData {
[contentsDictionaries addObject:[NSDictionary dictionaryWithObject:[NSArray arrayWithObject:coordString] forKey:dateString]];
}
+
+ [pool release];
+
}
- (void)dealloc {
Oops, something went wrong.

0 comments on commit 3db0dda

Please sign in to comment.