Fixing #75: memory leaks when Sparkle can't connect to the internet.

This commit is contained in:
andym committed 2007-12-04 07:14:58 +00:00
1 parent fe44611e2b
commit c2f173eca1
1 file changed
+3 -3
+3 -3
View File
@@ -53,12 +53,12 @@
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
RSS *feed;
RSS *feed = [RSS alloc];
@try
{
NSString *userAgent = [NSString stringWithFormat: @"%@/%@ (Mac OS X) Sparkle/1.1", [utilities hostAppName], [utilities hostAppVersion]];
feed = [[RSS alloc] initWithURL:url normalize:YES userAgent:userAgent];
feed = [feed initWithURL:url normalize:YES userAgent:userAgent];
if (!feed)
[NSException raise:@"SUFeedException" format:@"Couldn't fetch feed from server."];
@@ -70,7 +70,6 @@
[tempItems addObject:[[[SUAppcastItem alloc] initWithDictionary:current] autorelease]];
}
items = [[NSArray arrayWithArray:tempItems] retain];
[feed release];
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)])
[delegate performSelectorOnMainThread:@selector(appcastDidFinishLoading:) withObject:self waitUntilDone:NO];
@@ -83,6 +82,7 @@
}
@finally
{
[feed release];
[pool release];
}
}