Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
[#449] use weak instead of unsafe_unretained
Browse files Browse the repository at this point in the history
  • Loading branch information
mackuba committed Mar 29, 2015
1 parent 5ab89d0 commit 28b7ee2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Hive/Controllers/HIExportPrivateKeyWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ - (void)showPasswordPopoverOnButton:(id)button {
NSLocalizedString(@"Confirm", @"Confirm button in password entry form");
}

__unsafe_unretained id weakSelf = self;
__weak id weakSelf = self;
self.passwordInputViewController.onSubmit = ^(HIPasswordHolder *passwordHolder) {
[weakSelf exportKeyWithPassword:passwordHolder];
};
Expand Down
2 changes: 1 addition & 1 deletion Hive/Controllers/HILockScreenViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)awakeFromNib {
name:NSWorkspaceWillSleepNotification
object:nil];

__unsafe_unretained typeof(self) lwc = self;
__weak typeof(self) lwc = self;
self.passwordInputViewController.onSubmit = ^(HIPasswordHolder *passwordHolder) {
[lwc onPasswordEntered:passwordHolder];
};
Expand Down
4 changes: 2 additions & 2 deletions Hive/Controllers/HISendBitcoinsWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ - (void)showPasswordPopover:(NSButton *)sender forSendingBitcoin:(uint64)bitcoin

_passwordPopover = [self preparePasswordPopover];

__unsafe_unretained __typeof__ (self) weakSelf = self;
__weak __typeof__ (self) weakSelf = self;
self.passwordInputViewController.onSubmit = ^(HIPasswordHolder *passwordHolder) {
[weakSelf sendBitcoin:bitcoin toTarget:target password:passwordHolder];
};
Expand All @@ -1219,7 +1219,7 @@ - (void)showPasswordPopover:(NSButton *)sender forSendingBitcoin:(uint64)bitcoin
- (void)showPasswordPopover:(NSButton *)sender forPaymentRequest:(int)sessionId {
_passwordPopover = [self preparePasswordPopover];

__unsafe_unretained __typeof__ (self) weakSelf = self;
__weak __typeof__ (self) weakSelf = self;
self.passwordInputViewController.onSubmit = ^(HIPasswordHolder *passwordHolder) {
[weakSelf sendPaymentRequest:sessionId password:passwordHolder];
};
Expand Down
2 changes: 1 addition & 1 deletion Hive/Controllers/HISignMessageWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ - (void)showPasswordPopoverOnButton:(id)button {
NSLocalizedString(@"Confirm", @"Confirm button in password entry form");
}

__unsafe_unretained id weakSelf = self;
__weak id weakSelf = self;
self.passwordInputViewController.onSubmit = ^(HIPasswordHolder *passwordHolder) {
[weakSelf signMessageWithPassword:passwordHolder];
};
Expand Down
2 changes: 1 addition & 1 deletion Hive/Controllers/HIViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@property (nonatomic, copy) NSString *iconName;
@property (nonatomic, assign) NSUInteger badgeNumber;
@property (nonatomic, unsafe_unretained) HINavigationController *navigationController;
@property (nonatomic, weak) HINavigationController *navigationController;
@property (nonatomic, readonly) NSView *titleBarView;
@property (nonatomic, readonly) NSView *rightNavigationView;

Expand Down

0 comments on commit 28b7ee2

Please sign in to comment.