In Ableton Live 10.1.4, if a VST3 built with JUCE is deleted while a parameter is being changed from automation, Live will crash. Catching it in the debugger, it appears to happen here in
juce_VST3_wrapper.cpp (lines 2425-2428):
#if JUCE_VST3_EMULATE_MIDI_CC_WITH_PARAMETERS else if (juceVST3EditController->isMidiControllerParamID (vstParamID)) addParameterChangeToMidiBuffer (offsetSamples, vstParamID, value); #endif
It looks like
juceVST3EditController is a
nullptr at the time of the crash. Adding an explicit
nullptr check fixes the crash. Also, if
JUCE_VST3_EMULATE_MIDI_CC_WITH_PARAMETERS is not defined (e.g. if the plugin doesn’t take MIDI input), then the crash doesn’t happen.
I’ve confirmed that this happens with several different JUCE-based VST3 plugins, as well as the AudioPluginDemo built off of JUCE 5.4.5. However, The crash doesn’t seem to happen in other VST3 hosts, so I suspect this may be an issue with Live. In any case, it seems like an easy fix to add an explicit check in the wrapper.