Skip to content

Commit

Permalink
all but a few places use the typical [[[foo alloc] init] autorelease]…
Browse files Browse the repository at this point in the history
… pattern, removed 3 explicit releases and use autorelease instead. There are now only 2 exceptions to this pattern left. One is probably justified, the other looks like a leak.
  • Loading branch information
Sean McBride authored and Sean McBride committed Jan 1, 2010
1 parent dab8a36 commit b21b308
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions SUAppcast.m
Expand Up @@ -60,7 +60,7 @@ - (void)downloadDidFinish:(NSURLDownload *)download
CFRelease(download);

NSError *error = nil;
NSXMLDocument *document = [[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:0 error:&error];
NSXMLDocument *document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:0 error:&error] autorelease];
BOOL failed = NO;
NSArray *xmlItems = nil;
NSMutableArray *appcastItems = [NSMutableArray array];
Expand Down Expand Up @@ -148,11 +148,10 @@ - (void)downloadDidFinish:(NSURLDownload *)download
}

NSString *errString;
SUAppcastItem *anItem = [[SUAppcastItem alloc] initWithDictionary:dict failureReason:&errString];
SUAppcastItem *anItem = [[[SUAppcastItem alloc] initWithDictionary:dict failureReason:&errString] autorelease];
if (anItem)
{
[appcastItems addObject:anItem];
[anItem release];
}
else
{
Expand All @@ -162,8 +161,6 @@ - (void)downloadDidFinish:(NSURLDownload *)download
[dict removeAllObjects];
}
}

[document release];

if ([appcastItems count])
{
Expand Down
3 changes: 1 addition & 2 deletions SUStandardVersionComparator.m
Expand Up @@ -55,9 +55,8 @@ - (NSArray *)splitVersionString:(NSString *)version
newType = [self typeOfCharacter:character];
if (oldType != newType || oldType == kPeriodType) {
// We've reached a new segment
NSString *aPart = [[NSString alloc] initWithString:s];
NSString *aPart = [[[NSString alloc] initWithString:s] autorelease];
[parts addObject:aPart];
[aPart release];
[s setString:character];
} else {
// Add character to string and continue
Expand Down

0 comments on commit b21b308

Please sign in to comment.