diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-02-12 17:44:04 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-02-12 17:44:04 +0000 |
| commit | 92337c525e17a76dc896a11c4ddd0f7595bd7bd0 (patch) | |
| tree | 7e5cbd0f58e5552da6aba6173353ab458087ca49 | |
| parent | fed503f01540f43db73445247e9bc332333b1da6 (diff) | |
| download | pcsxr-92337c525e17a76dc896a11c4ddd0f7595bd7bd0.tar.gz | |
Fix a memory leak in non-ARC code.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82826 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rwxr-xr-x | macosx/HotkeyController.m | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/macosx/HotkeyController.m b/macosx/HotkeyController.m index 716c5d84..9b9a6de9 100755 --- a/macosx/HotkeyController.m +++ b/macosx/HotkeyController.m @@ -131,14 +131,15 @@ - (void)saveHotkey:(NSString*)keyIdent device:(NSString*)device deviceLabel:(NSString*)deviceLabel code:(NSString*)keyCode label:(NSString*)keyLabel { - NSMutableDictionary *tempUserMappings = [NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey:@"HotkeyBindings"]]; - [tempUserMappings setValue:[[NSDictionary alloc] initWithObjectsAndKeys: + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults] ; + NSMutableDictionary *tempUserMappings = [NSMutableDictionary dictionaryWithDictionary:[defaults dictionaryForKey:@"HotkeyBindings"]]; + [tempUserMappings setValue:[NSDictionary dictionaryWithObjectsAndKeys: device, @"device", deviceLabel, @"deviceName", keyCode, @"keyCode", keyLabel, @"keyLabel", nil] forKey:keyIdent]; - [[NSUserDefaults standardUserDefaults] setValue:tempUserMappings forKey:@"HotkeyBindings"]; + [defaults setValue:tempUserMappings forKey:@"HotkeyBindings"]; } - (NSString *) parseMappingDisplayString:(NSString *)keyString |
