diff options
| author | Vadim Shpakovski | 2012-10-08 13:34:34 +0300 |
|---|---|---|
| committer | Vadim Shpakovski | 2012-10-08 13:34:34 +0300 |
| commit | 3d4235f879e6f31b9bbcfb6b0fa2178de14d88aa (patch) | |
| tree | 69f6f03327a554aaa4c466ea9f7e0834ca67b1fa | |
| parent | 4099b62587959708bd02d1c49ec1c8fa39448cf4 (diff) | |
| download | MASShortcut-3d4235f879e6f31b9bbcfb6b0fa2178de14d88aa.tar.bz2 | |
Fixes problem with view controllers.
When view controller is loaded from NIB, it posts a notification about changes in user defaults. This causes user defaults watcher to reload the hotkey. Some shortcut objects perform cleanup in -[dealloc], but this method may be called later then -[init] in new shortcut objects. It resulted in freeing just created keyboard shortcut referring to the same user defaults key. The problem has been fixed by moving creation of the replacement hotkey in the next run loop when -[dealloc] is guaranteed to be called in previous watcher.
| -rw-r--r-- | MASShortcut+UserDefaults.m | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/MASShortcut+UserDefaults.m b/MASShortcut+UserDefaults.m index 3bdbab9..534830a 100644 --- a/MASShortcut+UserDefaults.m +++ b/MASShortcut+UserDefaults.m @@ -73,7 +73,7 @@ - (void)userDefaultsDidChange:(NSNotification *)note { [MASShortcut removeGlobalHotkeyMonitor:self.monitor]; - [self installHotKeyFromUserDefaults]; + [self performSelector:@selector(installHotKeyFromUserDefaults) withObject:nil afterDelay:0.0]; } - (void)installHotKeyFromUserDefaults |
