Skip to content

Commit 956385b

Browse files
authored
Add documentation note for delegates being weakly referenced (#2802)
1 parent f80d063 commit 956385b

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Sparkle/SPUStandardUpdaterController.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ SU_EXPORT @interface SPUStandardUpdaterController : NSObject
8181
Create a new `SPUStandardUpdaterController` programmatically.
8282
8383
The updater is started automatically. See `-startUpdater` for more information.
84+
85+
Note the `updaterDelegate` and `userDriverDelegate` are weakly referenced, so you are responsible for keeping them alive.
8486
*/
8587
- (instancetype)initWithUpdaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate userDriverDelegate:(nullable id<SPUStandardUserDriverDelegate>)userDriverDelegate;
8688

@@ -89,6 +91,8 @@ SU_EXPORT @interface SPUStandardUpdaterController : NSObject
8991
9092
You can specify whether or not you want to start the updater immediately.
9193
If you do not start the updater, you must invoke `-startUpdater` at a later time to start it.
94+
95+
Note the `updaterDelegate` and `userDriverDelegate` are weakly referenced, so you are responsible for keeping them alive.
9296
*/
9397
- (instancetype)initWithStartingUpdater:(BOOL)startUpdater updaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate userDriverDelegate:(nullable id<SPUStandardUserDriverDelegate>)userDriverDelegate;
9498

Sparkle/SPUStandardUserDriver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ SU_EXPORT @interface SPUStandardUserDriver : NSObject <SPUUserDriver>
3333
Initializes a Sparkle's standard user driver for user update interactions
3434
3535
@param hostBundle The target bundle of the host that is being updated.
36-
@param delegate The optional delegate to this user driver.
36+
@param delegate The optional delegate to this user driver. Note the standard user driver weakly references the delegate, so you are responsible for keeping it alive.
3737
*/
3838
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(nullable id<SPUStandardUserDriverDelegate>)delegate;
3939

Sparkle/SPUUpdater.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
5757
@param hostBundle The bundle that should be targeted for updating.
5858
@param applicationBundle The application bundle that should be waited for termination and relaunched (unless overridden). Usually this can be the same as hostBundle. This may differ when updating a plug-in or other non-application bundle.
5959
@param userDriver The user driver that Sparkle uses for user update interaction.
60-
@param delegate The delegate for `SPUUpdater`.
60+
@param delegate The delegate for `SPUUpdater`. Note the updater weakly references the delegate, so you are responsible for keeping it alive.
6161
*/
6262
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle applicationBundle:(NSBundle *)applicationBundle userDriver:(id <SPUUserDriver>)userDriver delegate:(nullable id<SPUUpdaterDelegate>)delegate;
6363

0 commit comments

Comments
 (0)