Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More fixes for 258060

Fixes a bug which could cause a crash when the update item is chosen by the delegate from the appcast. Thanks, Christiaan Hofman.
  • Loading branch information...
commit d2018032597822db4cb4eaa24eb0f950a29fc9b3 1 parent 74b206d
@andymatuschak andymatuschak authored
Showing with 8 additions and 6 deletions.
  1. +8 −6 SUBasicUpdateDriver.m
View
14 SUBasicUpdateDriver.m
@@ -79,22 +79,24 @@ - (void)appcastDidFinishLoading:(SUAppcast *)ac
{
if ([[updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)])
[[updater delegate] updater:updater didFinishLoadingAppcast:ac];
-
+
+ SUAppcastItem *item = nil;
+
// Now we have to find the best valid update in the appcast.
if ([[updater delegate] respondsToSelector:@selector(bestValidUpdateInAppcast:forUpdater:)]) // Does the delegate want to handle it?
{
- updateItem = [[updater delegate] bestValidUpdateInAppcast:ac forUpdater:updater];
+ item = [[updater delegate] bestValidUpdateInAppcast:ac forUpdater:updater];
}
else // If not, we'll take care of it ourselves.
{
// Find the first update we can actually use.
NSEnumerator *updateEnumerator = [[ac items] objectEnumerator];
do {
- updateItem = [updateEnumerator nextObject];
- } while (updateItem && ![self hostSupportsItem:updateItem]);
-
- [updateItem retain];
+ item = [updateEnumerator nextObject];
+ } while (item && ![self hostSupportsItem:item]);
}
+
+ updateItem = [item retain];
CFRelease(ac); // Remember that we're explicitly managing the memory of the appcast.
if (updateItem == nil) { [self didNotFindUpdate]; return; }
Please sign in to comment.
Something went wrong with that request. Please try again.