Skip to content

Commit 20a7fab

Browse files
committed
Fix a couple of leaks
1 parent a28b114 commit 20a7fab

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

iPhone/FileUploader/FileUploader.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ - (void) uploadFile:(NSURL*)file toServer:(NSString*)server withParams:(NSMutabl
153153
[postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
154154
[req setHTTPBody:postBody];
155155

156-
FileUploadDelegate* delegate = [[[FileUploadDelegate alloc] init] retain];
156+
FileUploadDelegate* delegate = [[FileUploadDelegate alloc] init];
157157
delegate.command = self;
158158
delegate.successCallback = successCallback;
159159
delegate.failCallback = failCallback;
160160
delegate.progressCallback = progressCallback;
161161

162-
NSURLConnection* connection = [[NSURLConnection connectionWithRequest:req delegate:delegate] retain];
162+
[[NSURLConnection connectionWithRequest:req delegate:delegate] retain];
163163
}
164164

165165
@end

iPhone/MapKitPlug/src/MapKit.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ - (void)setMapData:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)opt
9090
CGFloat height = 480.0f;
9191
// default at bottom
9292
BOOL atBottom = YES;
93-
94-
NSArray *pins = [[NSArray alloc] init];
95-
93+
9694
if ([options objectForKey:@"height"])
9795
{
9896
height=[[options objectForKey:@"height"] floatValue];
@@ -111,8 +109,8 @@ - (void)setMapData:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)opt
111109

112110

113111
SBJSON *parser=[[SBJSON alloc] init];
114-
pins = [parser objectWithString:[arguments objectAtIndex:0]];
115-
112+
NSArray *pins = [parser objectWithString:[arguments objectAtIndex:0]];
113+
[parser autorelease];
116114
CGRect webViewBounds = webView.bounds;
117115

118116
CGRect mapBounds;

0 commit comments

Comments
 (0)