Re: CFDictionaryCreateMutableCopy crash
Re: CFDictionaryCreateMutableCopy crash
- Subject: Re: CFDictionaryCreateMutableCopy crash
- From: Frederick Cheung <email@hidden>
- Date: Thu, 23 Sep 2004 13:36:39 +0200
On 23 Sep 2004, at 13:31, Gábor Sebestyén wrote:
More to mention: it very seems that all values of dict0 are released
before I could do anything with them. I've put a new line before
mutable copy to retain all values:
CFDictionaryApplyFunction(dict0, CFDictRetain, NULL);
...
void CFDictRetain(const void *key, const void *value, void *context)
{
CFShow(key);
fprintf(stderr, "value=0x%x\n", value); fflush(stderr);
CFShow(value);
CFRetain(value);
}
and the called CFDictRetain crashes at once it tries to display the
"value". The key is ok. So now what can I do to prevent such a
behavior of the system. Actually I cannot see further steps I could
take ..
That really isn't normal. I'm guessing that if you replace
CFDictionaryCreateMutable(NULL, 1, NULL, NULL); by
CFDictionaryCreateMutable(NULL, 1, &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks); you will avoid some memory borking
that could be your problem.
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