do not delete MIDIControllable* when dealing with pending MIDI Control requests - the MIDIControllable belongs to the surface code in controllables

This commit is contained in:
Paul Davis 2016-07-21 13:42:11 -04:00
parent bd80b2f144
commit 3bf7c4ef49

View file

@ -330,7 +330,6 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
++ptmp; ++ptmp;
if (((*i)->first)->get_controllable() == c) { if (((*i)->first)->get_controllable() == c) {
(*i)->second.disconnect(); (*i)->second.disconnect();
delete (*i)->first;
delete *i; delete *i;
pending_controllables.erase (i); pending_controllables.erase (i);
} }
@ -349,6 +348,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
if (!mc) { if (!mc) {
mc = new MIDIControllable (this, *_input_port->parser(), *c, false); mc = new MIDIControllable (this, *_input_port->parser(), *c, false);
controllables.push_back (mc);
} }
{ {