Re: CFDictionary
Re: CFDictionary
- Subject: Re: CFDictionary
- From: Eric Forget <email@hidden>
- Date: Tue, 02 Mar 2004 14:27:24 -0500
>
> CFDictionaryRef aProxy = SCPreferencesPathGetValue(session, paths);
>
> // make a copy of the proxy data so we can modify it
>
> dict = CFDictionaryCreateMutableCopy(NULL, 0, aProxy);
>
> // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
>
> // COMMENTING THE FOLLOWING LINE MAKES THE CODE WORK FINE
>
> // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> CFRelease(aProxy);
>
>
>
"If you create, copy, or retain a Core Foundation object, you alone are
>
responsible for releasing it when you no longer need it. If you did not
>
directly create or copy the object, you do not own it and should not
>
release it."
In other words, if you there is the word "Create" or "Copy" in the CF
function you need to release it. Otherwise you must not.
Eric
___________________________________________________________________
Eric Forget Cafederic
email@hidden <
http://www.cafederic.com/>
Fingerprint <86D5 38F5 E1FD 5D9C 71C3 BAA3 797E 70A4 6210 C684>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.