andymatuschak/TestMigration — Issue #60: Make SUUpdater's delegate a __weak reference
Author: andymatuschak
Created: 2011-10-23 16:38:34+00:00
State: open

***Karl Moskowski (kolpanic)** [reported (on Launchpad)](https://bugs.launchpad.net/sparkle/+bug/493182) on' 2009-12-06:*

Because SUUpdaters are cached in a static variable (sharedUpdaters),
their delegates can never be garbage collected. While this is not a
problem in a typical Sparkle-enabled app, where there's one SUUpdater
with a delegate that lives for the duration of the app, I created a
utility to do Sparkle checks of all installed apps
(http://bitbucket.org/kolpanic/coruscation/), where I instantiate a
SUUpdater for each bundle and their delegates are NSOperations. Since
the SUUpdater has a strong reference, the NSOperations are never garbage
collected even though they're removed from theb operation queue.

The declaration of the delegate ivar in SUUpdater.h should be declared as __weak:
IBOutlet id __weak delegate;