[futurebasic] Re: [FB] Dictionary help

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2007 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Wed, 19 Dec 2007 15:23:08 +1300
Joe Lertola wrote:

> dictValue(0) = fn CFNumberCreate( _kCFAllocatorDefault,  
> _kCFNumberIntType, @value )

> dictValue(1) =  fn CFSTR( "my test copyright info" )

> for x = 0 to 1
> CFRelease ( dictValue(x) )
> next x

Don't CFRelease the result of CFSTR.

CFString.h says:

CFSTR(), not being a "Copy" or "Create" function, does not return a new
reference for you. So, you should not release the return value. This is
much like constant C or Pascal strings --- when you use "hello world"
in a program, you do not free it.

Robert P.