Permalink
Browse files

Fix a couple of leaks

  • Loading branch information...
1 parent a28b114 commit 20a7fab10161e8649346859d49b4cf0cdfcab2bd @ascorbic ascorbic committed Jan 20, 2011
Showing with 5 additions and 7 deletions.
  1. +2 −2 iPhone/FileUploader/FileUploader.m
  2. +3 −5 iPhone/MapKitPlug/src/MapKit.m
@@ -153,13 +153,13 @@ - (void) uploadFile:(NSURL*)file toServer:(NSString*)server withParams:(NSMutabl
[postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[req setHTTPBody:postBody];
- FileUploadDelegate* delegate = [[[FileUploadDelegate alloc] init] retain];
+ FileUploadDelegate* delegate = [[FileUploadDelegate alloc] init];
delegate.command = self;
delegate.successCallback = successCallback;
delegate.failCallback = failCallback;
delegate.progressCallback = progressCallback;
- NSURLConnection* connection = [[NSURLConnection connectionWithRequest:req delegate:delegate] retain];
+ [[NSURLConnection connectionWithRequest:req delegate:delegate] retain];
}
@end
@@ -90,9 +90,7 @@ - (void)setMapData:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)opt
CGFloat height = 480.0f;
// default at bottom
BOOL atBottom = YES;
-
- NSArray *pins = [[NSArray alloc] init];
-
+
if ([options objectForKey:@"height"])
{
height=[[options objectForKey:@"height"] floatValue];
@@ -111,8 +109,8 @@ - (void)setMapData:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)opt
SBJSON *parser=[[SBJSON alloc] init];
- pins = [parser objectWithString:[arguments objectAtIndex:0]];
-
+ NSArray *pins = [parser objectWithString:[arguments objectAtIndex:0]];
+ [parser autorelease];
CGRect webViewBounds = webView.bounds;
CGRect mapBounds;

0 comments on commit 20a7fab

Please sign in to comment.