Weird Mac App Issue

Hi all !

      I'am facing an issue and i have a hard time figuring what's going on.
      I've got an APp that i'am coding sine aabout a month under windows. Everything is fine.
      I need a Mac build. So, i port my app to Xcode.
      Under MacOs, my app is randomly crashing or displaying weird artifactts ( sometime corrupted fonts or black background or missing images ). 
      Most of the time my app just works fine if i restart it.

      I've tried nearly all compile options configurations ( Enabling, disabling optimizations. Different MAC OS SDK, different GCC versions ), latest JUCE stable release ( 1.5.3 )  and latest JUCE GIT.
      Concerning memory allocation, i allways use ScopedPointer and, again, on windows my app runs fine.

      Does someone there has already faced this kind of issue ?

      Any Hint ?



Well if its crashing the first thing to do would be to have a look in the debugger (cmd+shift+Y by default) to see where. What sort of crash are you getting i.e. whats the message in the console (EXE_BAD_ACCESS for example)?

I would use the latest GIT as 1.5.3 is very old now and lots of things may have been fixed since.


      Thanks for your reply dave.
      I've tried asking the debugger for some clues. Crash are randoms, sometimes happens in Low-Level Cocoa Calls or in Juce Graphics function ( ex: g.drawPath(), glyph creation or in LookAndFeel draw functions ) ect... Usualling throwing a EXE_BAD_ACCESS or SIGABRT. I've mainly developped the app with JuceGIT. I've used 1.5.3 just to check...
     When it doesn't crash, i can, sometimes, have weird graphics issue ( Corrupted fonts, repaint artefacts )
     Again, i ain't got any memory management issue under Visual Studio.

Could it be a threading issue? I can’t remember exactly how but I used to get crashes in the graphics classes which turned out to basically bad threading practice. Do you have any shared classes which could becoming corrupt if they are used without any locking?


      I finally sorted it out. It was effectively a Threading issue. I've got an audiothread. I was opening my audiodevice with a fixed buffer size without checking wether the right buffer size was used...

On windows, the device was correctly opened but not on MAC…
Thanks dave !