mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
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.
This commit is contained in:
1 parent
74b206dc77
commit
d201803259
1 file changed
+8
-6
@@ -79,22 +79,24 @@
|
||||
{
|
||||
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; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user