I found two solutions how can I avoid the crash under Live 8.0.5 when VST version of JuceDemoPlugin collide with the AU one.
Just to mention - in the meantime I’ve upgraded the MacOSX to the latest 10.6.1 and all the time I try the Juce from the latest GIT tip - the problem still occurs.
The first solution is to differentiate the settings of two builds and then take the AU version from first build and VST from second.
So what I found that NEED to be different is the JUCE_ObjCExtraSuffix and JucePlugin_AUExportPrefix/JucePlugin_AUExportPrefixQuoted defines from JucePluginCharacteristics.h
the first build has following settings:
JUCE_ObjCExtraSuffix JuceDemoPlugin_v1
JucePlugin_AUExportPrefix JuceDemoAU_v1
JucePlugin_AUExportPrefixQuoted "JuceDemoAU_v1"
and the second one:
JUCE_ObjCExtraSuffix JuceDemoPlugin_v2
JucePlugin_AUExportPrefix JuceDemoAU_v2
JucePlugin_AUExportPrefixQuoted "JuceDemoAU_v2"
Besides of that the ONLY change I’m doing to the JuceDemo project from tip is removing RTAS files according to your instructions.
The AU version from one build doesn’t collide from the VST from the second build. However the versions taken from the same build crash Live each time.
The interesting thing is that differentiating builds only with AUExportPrefixes prevents versions from crash during the open/close GUI test I described in the first post. But if there is no difference in JUCE_ObjCExtraSuffixes in builds then I got a crash every time I try to quit Live when such two versions are used.
So the complete solution is to make differences in both Prefixes and ObjCExtraSuffix.
That’s strange, I know, but it’s really 100% deterministic. I use the latest Live and the latest JUCE, the latest MacOSX and XCode too so there should be quite easy to reproduce.
The second solution is based on building two versions (VST/AU) NOT using the polymorphic plugins mechanism.
So I built the AU version excluding VST wrapper files during the build.
Then I built the VST version excluding all the unnecessary AU files (wrapper, AUBase, PublicUtility etc.)
Before starting I restored all juce so there was no differences in defines from example above.
Versions built in this way don’t crash the Live during the open/close gui test. But crash during closing Live still exists. To avoid it I had once again to differentiate versions with JUCE_ObjCExtraSuffix values. Then all the things run smoothly.
I noticed also another thing. When I had the versions which cause crash during Live exit (no matter about the solution) I found that VST influences key receiving in AU somehow. I mean that when you put only AU to Live and then click to the TextEdit, put some numbers from keyboard and then press Enter everything is fine. But when you first put the VST, then put the AU and click the TextEdit in AU, type some numbers you are not able to use Enter. You can leave the TextEdit area with Tab or by clicking somewhere else on the GUI but Enter does nothing. And then when you try to quit Live it will crash.
Do you have any ideas Jules, why it may happen? I digged across the Juce files but didn’t found anything.
Here is once again updated crash log from the open/close gui test. It’s crash when you test the regular JuceDemoPlugin from the tip without any changes. Just the procedure to test I described in first post.
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 ...rialsoftware.JuceDemoPlugin 0x19eaf32e juce::Component::addAndMakeVisible(juce::Component*, int) + 26 (juce_amalgamated.cpp:38898)
1 ...rialsoftware.JuceDemoPlugin 0x19f695f2 EditorCompHolder::EditorCompHolder(juce::AudioProcessorEditor*) + 170 (juce_AU_Wrapper.mm:946)
2 ...rialsoftware.JuceDemoPlugin 0x19f672d9 -[JuceUIViewClass_1_50_JuceDemoAU initWithFilter:withAU:withComponent:] + 71 (juce_AU_Wrapper.mm:998)
3 ...rialsoftware.JuceDemoPlugin 0x19f6724f -[JuceUICreationClass_1_50_JuceDemoAU uiViewForAudioUnit:withSize:] + 225 (juce_AU_Wrapper.mm:1116)
4 com.ableton.live 0x000cc650 OMxDMemoryManager::~OMxDMemoryManager() + 5046
5 com.ableton.live 0x000ccafb OMxDMemoryManager::~OMxDMemoryManager() + 6241
6 com.ableton.live 0x000aaf8d OMidiAllNotesOffEvent::~OMidiAllNotesOffEvent() + 5767
7 com.ableton.live 0x000c4572 void OProcessorCreateManager::SOnProcessorCreate<OVstProcessor>(OThreadMessage&) + 21456
8 com.ableton.live 0x0005f908 OMessageAllocator::~OMessageAllocator() + 19028
9 com.ableton.live 0x00040e8e void OProcessorCreateManager::SOnProcessorCreate<ODoubleProcessor>(OThreadMessage&) + 50254
10 com.ableton.live 0x000627f1 OMessageAllocator::~OMessageAllocator() + 31037
11 com.ableton.live 0x00070f54 OBeatEvent::~OBeatEvent() + 5210
12 com.ableton.live 0x00cb57fd ACollision::~ACollision() + 16263
13 com.ableton.live 0x00d7a6e6 OVstParameterRecord::OVstParameterRecord(OVstParameterRecord const&) + 7394
14 com.ableton.live 0x003b213e ARemoteableEnum::~ARemoteableEnum() + 762
15 com.ableton.live 0x003b88f7 APtrBase::~APtrBase() + 445
16 com.ableton.live 0x003a9266 AManeuver::~AManeuver() + 518
17 com.ableton.live 0x00d7b218 OVstParameterRecord::OVstParameterRecord(OVstParameterRecord const&) + 10260
18 com.ableton.live 0x003a9227 AManeuver::~AManeuver() + 455
19 com.ableton.live 0x0135645b AVolumePack::~AVolumePack() + 13059
20 com.ableton.live 0x01356b09 AVolumePack::~AVolumePack() + 14769
21 com.ableton.live 0x01356bd4 AVolumePack::~AVolumePack() + 14972
22 com.ableton.live 0x014a3a6d AScalingGraphPort::~AScalingGraphPort() + 25537
23 com.ableton.live 0x014a5c23 AScalingGraphPort::~AScalingGraphPort() + 34167
24 com.ableton.live 0x01451d14 AHyperLinkBitmapView::~AHyperLinkBitmapView() + 1350
25 com.ableton.live 0x014a4da0 AScalingGraphPort::~AScalingGraphPort() + 30452
26 com.ableton.live 0x013c2141 AWindowBase::DoBeforePrepareClose() + 49547
27 com.ableton.live 0x013c22c2 AWindowBase::DoBeforePrepareClose() + 49932
28 com.ableton.live 0x013bde12 AWindowBase::DoBeforePrepareClose() + 32348
29 com.apple.AppKit 0x901a3154 -[NSWindow sendEvent:] + 5693
30 com.apple.AppKit 0x900bbceb -[NSApplication sendEvent:] + 6431
31 com.apple.AppKit 0x9004f6fb -[NSApplication run] + 917
32 com.ableton.live 0x013bca4e AWindowBase::DoBeforePrepareClose() + 27288
33 com.ableton.live 0x013b2ecb AApplication::~AApplication() + 7671
34 com.ableton.live 0x00002fd2 0x1000 + 8146
35 com.ableton.live 0x00002ef9 0x1000 + 7929
Cheers…