fixed circular reference leak + 1 potential leak
Showing
3 changed files
with
8 additions
and
1 deletions
@@ -96,6 +96,7 @@ static CGImageRef _markerBlue = nil; | @@ -96,6 +96,7 @@ static CGImageRef _markerBlue = nil; | ||
96 | NSString *path = [[NSBundle mainBundle] pathForResource:filename ofType:@"png"]; | 96 | NSString *path = [[NSBundle mainBundle] pathForResource:filename ofType:@"png"]; |
97 | CGDataProviderRef dataProvider = CGDataProviderCreateWithFilename([path UTF8String]); | 97 | CGDataProviderRef dataProvider = CGDataProviderCreateWithFilename([path UTF8String]); |
98 | CGImageRef image = CGImageCreateWithPNGDataProvider(dataProvider, NULL, FALSE, kCGRenderingIntentDefault); | 98 | CGImageRef image = CGImageCreateWithPNGDataProvider(dataProvider, NULL, FALSE, kCGRenderingIntentDefault); |
99 | + [NSMakeCollectable(image) autorelease]; | ||
99 | CGDataProviderRelease(dataProvider); | 100 | CGDataProviderRelease(dataProvider); |
100 | 101 | ||
101 | return image; | 102 | return image; |
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | RMMapContents *contents; | 17 | RMMapContents *contents; |
18 | } | 18 | } |
19 | 19 | ||
20 | -@property (retain, readwrite) RMMapContents *contents; | 20 | +@property (assign, readwrite) RMMapContents *contents; |
21 | 21 | ||
22 | - (id)initWithContents:(RMMapContents *)mapContents; | 22 | - (id)initWithContents:(RMMapContents *)mapContents; |
23 | 23 |
@@ -77,6 +77,12 @@ static RMMarkerStyles *sharedMarkerStyles = nil; | @@ -77,6 +77,12 @@ static RMMarkerStyles *sharedMarkerStyles = nil; | ||
77 | return self; | 77 | return self; |
78 | } | 78 | } |
79 | 79 | ||
80 | +- (void)dealloc | ||
81 | +{ | ||
82 | + [styles release]; | ||
83 | + [super dealloc]; | ||
84 | +} | ||
85 | + | ||
80 | - (void) addStyle: (RMMarkerStyle*) style withName: (NSString*) name | 86 | - (void) addStyle: (RMMarkerStyle*) style withName: (NSString*) name |
81 | { | 87 | { |
82 | [styles setObject:style forKey:name]; | 88 | [styles setObject:style forKey:name]; |
-
Please register or login to post a comment