From 92337c525e17a76dc896a11c4ddd0f7595bd7bd0 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Tue, 12 Feb 2013 17:44:04 +0000 Subject: Fix a memory leak in non-ARC code. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82826 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/HotkeyController.m | 7 ++++--- 1 file 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 -- cgit v1.2.3