gap-dev-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gap-dev-discuss] exception when quitting Cynthiune


From: Riccardo Mottola
Subject: Re: [Gap-dev-discuss] exception when quitting Cynthiune
Date: Fri, 04 May 2012 10:29:06 +0200
User-agent: Mozilla/5.0 (X11; NetBSD i386; rv:11.0) Gecko/20120409 Thunderbird/11.0

Hi,

it took me a bit but I think I fixed it, I commited a different patch. It works for me. Try for you!.

Normally, what you put in a dictionary, you get out. But my take is that when you read it back as a preference (that is a PLIST) you loose the "Mutable" attribute. Most proabbly both for Arrays and Dictionaries. I changed the code to reallocate the dict into a mutable dict on load, so that the rest of the class uses it as expected.

Riccardo


On 05/03/12 19:54, Philippe Roussel wrote:
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








reply via email to

[Prev in Thread] Current Thread [Next in Thread]