Occasionally, the debugger raises exception with what seems to be zero sized message for no appearant reason.
I have the following in processBlock() to deliver midi events produced from Juce components to the DAW Plugin output.
for (MidiBuffer::Iterator i(midiOutDAW); i.getNextEvent(mDAW, time);) { midiMessages.addEvent(mDAW,time); //output event to DAW }; midiOutDAW.clear();
The MidiBuffer midiOutDAW is defined in PluginProcessor.h and a raw pointer MidiBuffer* is passed to the constructor of components (MidiBuffer* myMidiOutBufferDAW;) that generate the events
mySlider->onValueChange = [this] { auto message = MidiMessage::controllerEvent(1, Get_CC(myIndex), (int)mySlider->getValue()); myMidiOutBufferDAW->addEvent(message, 0); };
Is the raw pointer reference threadsafe? If not, what to do?
Thanks for input
