Re: Crazy CFPreferences!
Re: Crazy CFPreferences!
- Subject: Re: Crazy CFPreferences!
- From: Frederick Cheung <email@hidden>
- Date: Mon, 18 Oct 2004 13:22:19 +0100
On 18 Oct 2004, at 12:24, SEBESTYÉN Gábor wrote:
Hi,
I actually writing (porting) a game which is mixed in Cocoa and C++
(using Core Foundation). I have a game config handler class written in
c++ which uses CFPreferences API (I don't use it from Cocoa only via
CF).
If I want to write to the preferences it badly crashes:
CFDictionaryRef dict0 = CFPreferencesCopyAppValue(ksect,
kCFPreferencesCurrentApplication);
CFMutableDictionaryRef dict;
if (dict0) {
dict = CFDictionaryCreateMutableCopy(NULL, 0, dict0); // it crashes
here
CFRelease(dict0);
} else {
dict = CFDictionaryCreateMutable(NULL, 1, NULL, NULL);
}
Since you create the dictionary with null callbacks it doesn't retain
objects you add to it. I'd guess that because of this dict0 may contain
already released (ie junk) values, from the first time the data was
saved.
Fred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden