[futurebasic] Re: [FB] kCFTypeArrayCallBacks

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2006 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Wed, 1 Mar 2006 22:14:08 +1300
Bernie wrote:

> In my attempts to use CFArray's default callback functions  
> (kCFTypeArrayCallBacks), I've come up with this code. It doesn't  
> cure the leak and I haven't a clue what I'm doing so I hope someone  
> here can show me where I'm going wrong.

Yes. Release each dict
    CFRelease( dict )
as soon as it has been appended to the array. The array's callbacks  
will retain all items added, and release them later.



A typical code pattern is:
   1. myCFThing = fn CFXxxxCreateOrCopyZzzz( .... )
   2. do something with myCFThing
   3. CFRelease( myCFThing )

Robert P.