From b12f624890216d46aa20a51ae524abd77eb2e5b4 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 3 Jun 2010 12:37:32 +0000 Subject: [PATCH] modified version of a patch from robin gareus to avoid leaving pointers to data buffers owned by Session as the buffer for a JACK MIDI event. Robin - it would be good if you could test and confirm (email?) that my modified version also works git-svn-id: svn://localhost/ardour2/branches/3.0@7218 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/midi++2/jack_midiport.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/midi++2/jack_midiport.cc b/libs/midi++2/jack_midiport.cc index b761efdd28..ba675082a4 100644 --- a/libs/midi++2/jack_midiport.cc +++ b/libs/midi++2/jack_midiport.cc @@ -145,8 +145,14 @@ JACK_MidiPort::write(byte * msg, size_t msglen, timestamp_t timestamp) } if (vec.len[0]) { + if (!vec.buf[0]->owns_buffer()) { + vec.buf[0]->set_buffer (0, 0, true); + } vec.buf[0]->set (msg, msglen, timestamp); } else { + if (!vec.buf[1]->owns_buffer()) { + vec.buf[1]->set_buffer (0, 0, true); + } vec.buf[1]->set (msg, msglen, timestamp); }