From 28b7ee2c1b7568c0fb5184d7e981cced633dc51b Mon Sep 17 00:00:00 2001 From: Jakub Suder Date: Mon, 30 Mar 2015 00:32:34 +0200 Subject: [PATCH] [#449] use weak instead of unsafe_unretained --- Hive/Controllers/HIExportPrivateKeyWindowController.m | 2 +- Hive/Controllers/HILockScreenViewController.m | 2 +- Hive/Controllers/HISendBitcoinsWindowController.m | 4 ++-- Hive/Controllers/HISignMessageWindowController.m | 2 +- Hive/Controllers/HIViewController.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Hive/Controllers/HIExportPrivateKeyWindowController.m b/Hive/Controllers/HIExportPrivateKeyWindowController.m index 0225cede..10568dc5 100644 --- a/Hive/Controllers/HIExportPrivateKeyWindowController.m +++ b/Hive/Controllers/HIExportPrivateKeyWindowController.m @@ -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]; }; diff --git a/Hive/Controllers/HILockScreenViewController.m b/Hive/Controllers/HILockScreenViewController.m index 74e6076a..99fd58bb 100644 --- a/Hive/Controllers/HILockScreenViewController.m +++ b/Hive/Controllers/HILockScreenViewController.m @@ -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]; }; diff --git a/Hive/Controllers/HISendBitcoinsWindowController.m b/Hive/Controllers/HISendBitcoinsWindowController.m index 78aef3d3..5231bf11 100644 --- a/Hive/Controllers/HISendBitcoinsWindowController.m +++ b/Hive/Controllers/HISendBitcoinsWindowController.m @@ -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]; }; @@ -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]; }; diff --git a/Hive/Controllers/HISignMessageWindowController.m b/Hive/Controllers/HISignMessageWindowController.m index 27aaff91..b498d0e0 100644 --- a/Hive/Controllers/HISignMessageWindowController.m +++ b/Hive/Controllers/HISignMessageWindowController.m @@ -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]; }; diff --git a/Hive/Controllers/HIViewController.h b/Hive/Controllers/HIViewController.h index bce3c708..0863b520 100644 --- a/Hive/Controllers/HIViewController.h +++ b/Hive/Controllers/HIViewController.h @@ -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;