JUCE Assertion failure in juce_VST3_Wrapper.cpp:3138 and 3142

hello,
In a audio plugin, i have some “audio task” that may be a little too long for the processor ProcessBlock() function, so i do it parallel: i create a thread 2 in processor constructor that communicates with the thread 1 in function ProcessBlock(). In the processor destructor() , this thread 2 is asked to finish by an atomic variable and we wait that it finish with the function join().
(this “audio task” is pitch detection).

It seems to work except that when i close the DAW (Ardour7) i have a message:
JUCE Assertion failure in juce_VST3_Wrapper.cpp:3138
JUCE Assertion failure in juce_VST3_Wrapper.cpp:3142

What it means? what is wrong?
Thanks,
Frédéric.

The assertion tells you where you need to look, the numbers are line numbers where the assertion hits. The file is in modules/juce_audio_plugin_client/VST3.

    tresult PLUGIN_API activateBus (Vst::MediaType type,
                                    Vst::BusDirection dir,
                                    Steinberg::int32 index,
                                    TBool state) override
    {
        // The host is misbehaving! The plugin must be deactivated before setting new arrangements.
        jassert (! active);

[...]

Could be that the way you clean up your worker thread prevents the host from properly shutting your plugin down or something. Try putting a breakpoint here to figure out what’s happening and work your way backwards from there.

1 Like

Thanks i will try to find the origin of the problem.