For a music library plugin I have an AudioDeviceManager in the editor for the sole purpose of auditioning the tracks, before they are selected. This used to work for 3 years now (released product with plenty documented users).
I haven’t worked on the project since beginning this year, but updating to develop I experience a crash far away from my code when the AudioDeviceSelectorComponent is populated on creation of the editor:
I agree, it will be nasty to track down. But at least it happens every time here, not just sometimes, and I guess, you will find a problem, that is most likely not limited to that particular case.
You’ll need to rebuild the AudioPluginHost and plug-in with these changes.
Jules’ PopupMenu changes weren’t the culprit, but they were triggering some weird behaviour that we haven’t run into before. Essentially there was a symbol collision happening with the static EmptyString object at the top of juce_String.cpp when running a JUCE plug-in in the JUCE host which was causing the checks for empty strings to be incorrect as they were relying on the address of the static object.
I don’t know why this would crash in Final Cut though, are you sure it’s the same crash you’re seeing there?
You are right, it’s a different crash. The project is using the deprecated AudioProcessorValueTreeState createAndAddParameter, and the DuplicateParamIDCheck gets into deleting an AsyncUpdater, which jasserts() sometimes (if an update is pending).
Now I need to get that AsyncUpdater resolved.
It happens when skimming over the timeline. Very strange, but FCPX is creating multiple instances on the fly, so it is more likely to catch these kind of things than a host, that only creates an instance once, and most times unloads only once the session is over…
BTW. in release I get crashes as well, so it is probably not just a benign jassert().
If you add a destructor to DuplicateParamIDCheck and add a call to cancelPendingUpdate() in there does that solve the first crash? I can’t see how this would crash in release mode though as the check is only added for debug builds.
Awesome, you’re great! That does indeed fix the problem in debug and release.
Seems, FCPX is discarding instances before they even finished the setup. So the cancelPendingUpdate() in the destructor is a good safety measure to add.