Please remove (crashy) message thread dependency from AudioProcessor construction

Actually this only a debug problem, but it needs to be fixed.

checkDuplicateParamIDs will be always called from the message thread, which is very crashy if a AudioProcessor is created from a helper thread in the background. (While adding parameters, because the Array holding the flat-parameter list, will maybe reallocated while construction)

Possible fixes:

make a full check on every time a parameter is added on the same thread (easy to implement, not performant but I think for the debug version okay)
or
don’t call checkDuplicateParamIDs until the plugin is fully constructed (but hard detect when plugin is ready)
or
use a critical-section for accessing parameters-array (I think this is an overkill solution)

BTW: DSP-Routines shouldn’t mess around with message-thread, that’s the callers responsibility to ensure integrity.

1 Like

or just add a flag to disable checking for duplicate IDs :wink:

Thank you for reporting.