Hi, I'm creating a plugin which GUI react to some midi messages, like BPM or host time. I'm pretty newbie with threads, but I know that if I want to call to a Component::repaint() or Component::resized() I must create a MessageManagerLock instance, right? The problem is that doing it in AudioProcessor:processBlock() crash the plugin and the host.
My code is something like this:
void MyPluginAudioProcessor::processBlock(AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
const MessageManagerLock mmLock;
// someconditions is calculated before the next line
if (someconditions == true) pMainBar->repaint();
If you comment everything except the mmLock line, it still crash. If you dont place the MessageManagerLock, Component's assertion occurs.
Please, what am I doing wrong?