Le 03/05/2012 19:15, Sebastian Reitenbach a écrit :
Hi,
quitting Cynthiune, I usually saw the following exception on the console:
2012-05-03 18:57:00.203 Cynthiune[11772] Problem posting
notification:<NSException: 0x7cb257a4> NAME:NSInvalidArgumentException
REASON:GSDictionary(instance) does not recognize setObject:forKey: INFO:(null)
Which happens in line 258 of GeneralPreferences.m
Below my patch to fix the problem, which works for me.
I'd appreciate if someone could take a look and let me know if there might be
problems with it.
The patch makes sense and should be applied in my opinion.
The thing is, I'm not sure I understand why the current code doesn't
work. Can someone show me the light ?
Sebastian
Index: GeneralPreference.m
===================================================================
RCS file: /sources/gap/gap/user-apps/Cynthiune/GeneralPreference.m,v
retrieving revision 1.3
diff -u -r1.3 GeneralPreference.m
--- GeneralPreference.m 2 May 2012 22:36:36 -0000 1.3
+++ GeneralPreference.m 3 May 2012 17:11:21 -0000
@@ -251,12 +251,13 @@
NSMutableDictionary *windowsInformation;
NSString *frameString;
- windowsInformation = [preference objectForKey: @"WindowsInformation"];
+ windowsInformation = [[NSMutableDictionary alloc] initWithDictionary:[preference
objectForKey: @"WindowsInformation"]];
information = [NSMutableArray arrayWithCapacity: 3];
frameString = [aWindow stringWithSavedFrame];
[information addObject: frameString];
[windowsInformation setObject: information forKey: windowName];
[self save];
+ [windowsInformation release];
}
- (void) restoreInformation: (NSWindow *) aWindow