Authored by Justin R. Miller

resolve some very subtle memory problems under non-ARC

... ... @@ -67,7 +67,7 @@
{
if ( ! _imageURLString)
{
NSString *imagerySetString;
NSString *imagerySetString = nil;
if (_imagerySet == RMBingImagerySetAerial)
imagerySetString = @"Aerial";
... ...
... ... @@ -103,7 +103,7 @@
[[NSNotificationCenter defaultCenter] postNotificationName:RMTileRequested object:[NSNumber numberWithUnsignedLongLong:RMTileKey(tile)]];
});
__block UIImage *image;
__block UIImage *image = nil;
[queue inDatabase:^(FMDatabase *db)
{
... ... @@ -250,7 +250,7 @@
- (NSString *)legend
{
__block NSString *legend;
__block NSString *legend = nil;
[queue inDatabase:^(FMDatabase *db)
{
... ... @@ -332,7 +332,7 @@
- (NSString *)shortName
{
__block NSString *shortName;
__block NSString *shortName = nil;
[queue inDatabase:^(FMDatabase *db)
{
... ... @@ -353,7 +353,7 @@
- (NSString *)longDescription
{
__block NSString *description;
__block NSString *description = nil;
[queue inDatabase:^(FMDatabase *db)
{
... ... @@ -374,7 +374,7 @@
- (NSString *)shortAttribution
{
__block NSString *attribution;
__block NSString *attribution = nil;
[queue inDatabase:^(FMDatabase *db)
{
... ...
... ... @@ -70,7 +70,7 @@
options:0
error:nil] retain];
id dataObject;
id dataObject = nil;
if (mapView && (dataObject = [_infoDictionary objectForKey:@"data"]) && dataObject)
{
... ... @@ -80,7 +80,7 @@
{
NSURL *dataURL = [NSURL URLWithString:[dataObject objectAtIndex:0]];
NSMutableString *jsonString;
NSMutableString *jsonString = nil;
if (dataURL && (jsonString = [NSMutableString stringWithContentsOfURL:dataURL encoding:NSUTF8StringEncoding error:nil]) && jsonString)
{
... ... @@ -90,7 +90,7 @@
[jsonString replaceCharactersInRange:NSMakeRange([jsonString length] - 2, 2) withString:@""];
}
id jsonObject;
id jsonObject = nil;
if ((jsonObject = [NSJSONSerialization JSONObjectWithData:[jsonString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil]) && [jsonObject isKindOfClass:[NSDictionary class]])
{
... ... @@ -146,7 +146,7 @@
- (id)initWithReferenceURL:(NSURL *)referenceURL enablingDataOnMapView:(RMMapView *)mapView
{
id dataObject;
id dataObject = nil;
if ([[referenceURL pathExtension] isEqualToString:@"jsonp"])
referenceURL = [NSURL URLWithString:[[referenceURL absoluteString] stringByReplacingOccurrencesOfString:@".jsonp"
... ... @@ -198,7 +198,7 @@
if ([self.infoDictionary objectForKey:@"scheme"] && [[self.infoDictionary objectForKey:@"scheme"] isEqual:@"tms"])
y = pow(2, zoom) - tile.y - 1;
NSString *tileURLString;
NSString *tileURLString = nil;
if ([self.infoDictionary objectForKey:@"tiles"])
tileURLString = [[self.infoDictionary objectForKey:@"tiles"] objectAtIndex:0];
... ... @@ -212,7 +212,7 @@
if (_imageQuality != RMMapBoxSourceQualityFull)
{
NSString *qualityExtension;
NSString *qualityExtension = nil;
switch (_imageQuality)
{
... ... @@ -282,7 +282,7 @@
{
id bounds = [self.infoDictionary objectForKey:@"bounds"];
NSArray *parts;
NSArray *parts = nil;
if ([bounds isKindOfClass:[NSArray class]])
parts = bounds;
... ...
... ... @@ -94,7 +94,7 @@
- (id)initWithMapBoxMarkerImage:(NSString *)symbolName tintColor:(UIColor *)color size:(RMMarkerMapBoxImageSize)size
{
NSString *sizeString;
NSString *sizeString = nil;
switch (size)
{
... ... @@ -112,7 +112,7 @@
break;
}
NSString *colorHex;
NSString *colorHex = nil;
if (color)
{
... ... @@ -140,7 +140,7 @@
(colorHex ? [@"+" stringByAppendingString:[colorHex stringByReplacingOccurrencesOfString:@"#" withString:@""]] : @"+ff0000"),
(useRetina ? @"@2x" : @"")]];
UIImage *image;
UIImage *image = nil;
NSString *cachePath = [NSString stringWithFormat:@"%@/%@", kCachesPath, [imageURL lastPathComponent]];
... ...