Crashes inside CFStringDeallocate

2018-05-25 Thread Vojtěch Meluzín
Hi, I have received a few cases like the trace below - it always happens in OSX 10.10 and runModalForWindow and crashes in CFStringDeallocate. Any ideas what that could be? I have tested 4 computers, with like 6 different OSX versions, always works here, yet there are machines where this happens a

Re: Crashes inside CFStringDeallocate

2018-05-25 Thread Ken Thomases
On May 25, 2018, at 5:44 AM, Vojtěch Meluzín wrote: > > I have received a few cases like the trace below - it always happens in OSX > 10.10 and runModalForWindow and crashes in CFStringDeallocate. Any ideas > what that could be? Have you run your app with the Zombies instrument? > […] NSStrings

Re: Crashes inside CFStringDeallocate

2018-05-25 Thread Vojtěch Meluzín
Thanks for the reply Ken. I don't really know what Zombies instrument is, I'll check. The GetLength returns the number of UTF-16 characters (hence half of the buffer length), not including zero terminator. Cheers! Vojtech 2018-05-25 16:26 GMT+02:00 Ken Thomases : > On May 25, 2018, at 5:44 AM, V

Re: Crashes inside CFStringDeallocate

2018-05-25 Thread Vojtěch Meluzín
Ok so I got a solution - it's the utf16 indeed. When I use [NSString stringWithUTF8String] instead, it doesn't crash. Considering it does that only on 10.10 (and probably older), it seems like OSX malfunction... oh well... Fortunately no big deal. Cheers! Vojtech www.meldaproduction.com 2018-05-2

Re: Crashes inside CFStringDeallocate

2018-05-25 Thread Jack Brindle
Not necessarily. I have never seen a guarantee that the C++ string functions output their data in the exact format that [NSString stringWithCharacters:length:] needs as an input. As you discovered, getting UTF8 from the C++ string does give you proper data for the corresponding NSString creator