I am porting a Classic application to Carbon and am experiencing a
crash
from using CFSTR() that I cannot understand. The program always
crashes for
a colleague of mine on three different machines running 10.4, 10.3,
and
10.2. From what I can tell from the crash log, it crashes inside
of CFSTR()
for him, but it never crashes for me.
In my code that initializes CoreMIDI, I was originally doing the
following.
Is InitCoreMidiDriver called more than once? Any chance
MIDIClientCreate is releasing its first parameter? CFSTR only
allocates a string the first time it is called, so you must either
(a) never CFRelease a CFSTR string, or (b) remember to CFRetain it
first.
Other possible reasons:
* you've replaced the standard CFAllocator (via CFAllocatorSetDefault
(myAllocatorRef)), and it has problems
* good ol' fashioned memory trashing
It looks like __CFStringMakeConstantString can also die if the string
has extended characters that aren't MacRoman (obviously not the case
here, as you're using only ASCII).
CoreFoundation is open source, so take a peek at CFString.c (in the
"CF" project) if you want to see exactly what it does.
- Dan
Dan Wright
banasmoo software
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden