On Oct 10, 2006, at 3:21 PM, Mars Saxman wrote:
On Oct 8, 2006, at 3:50 PM, Charles Yeomans wrote:
How does memory management work with CFStringRef? Presumably if I
create a CFStringRef, or let the framework do it implicitly in the
course of conversion, then the framework correctly manages the
reference count.
RB's string management code handles reference counts for
CFStringRef values in exactly the same way that it does for
strings, objects, and arrays. In short: retain on assignment,
release on overwrite, release when variable goes out of scope;
parameter passing is assignment on the call side, return values are
assignment on the callee side.
But what if I obtain a CFStringRef by reference, or as the return
value of a function? Judging from some crashes I can generate, it
looks like a CFStringRef always calls CFRelease when the
CFStringRef reference is destroyed.
Yes, that's correct.
Thanks. I think I've just about got this sorted out.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>