Closed sphaero closed 3 years ago
It does seem to be a threading issue. Adding mutex locks around the code modifying the midiMessages vector makes it stable!
added sending the messages vector through osc.
Yes, this can happen if you start to have multiple threads involved, ie. MIDI and OSC receiver etc. I can add a note to the example about this.
Ok, see e44c14a1fc76fe33786cb21f2fd908d0b4217605.
Just testing the MidiIn example and added sending the messages vector through osc. Now running into segfaults when clearing the messages vector.
So receiving the messages like this
But clearing the vector when they are send:
(could also be
midiIn.midiMessages.clear()
)However this segfaults on
midiMessages.erase(midiMessages.begin());
which is puzzling unless this is happening in multiple threads?Is the ofEvent originating from a different thread? Or any other ideas?
Rg,
Arnaud