• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CFDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Re: CFDictionary (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: CFDictionary
  • Next by Date: Re: Resource fork question
  • Previous by thread: Re: CFDictionary
  • Next by thread: Re: CFDictionary
  • Index(es):
    • Date
    • Thread