13
0

should not really bind a shared_ptr<Port> to a sigc slot, so don't do that

This commit is contained in:
Paul Davis 2016-12-18 00:07:17 +00:00
parent 1223c8d1cd
commit ecc2348ecc
2 changed files with 11 additions and 3 deletions

View File

@ -197,6 +197,8 @@ FaderPort::FaderPort (Session& s)
FaderPort::~FaderPort () FaderPort::~FaderPort ()
{ {
cerr << "~FP\n";
all_lights_out (); all_lights_out ();
if (_input_port) { if (_input_port) {
@ -247,7 +249,7 @@ FaderPort::start_midi_handling ()
* method, which will read the data, and invoke the parser. * method, which will read the data, and invoke the parser.
*/ */
_input_port->xthread().set_receive_handler (sigc::bind (sigc::mem_fun (this, &FaderPort::midi_input_handler), _input_port)); _input_port->xthread().set_receive_handler (sigc::bind (sigc::mem_fun (this, &FaderPort::midi_input_handler), boost::weak_ptr<AsyncMIDIPort> (_input_port)));
_input_port->xthread().attach (main_loop()->get_context()); _input_port->xthread().attach (main_loop()->get_context());
} }
@ -749,8 +751,14 @@ FaderPort::connect_session_signals()
} }
bool bool
FaderPort::midi_input_handler (Glib::IOCondition ioc, boost::shared_ptr<ARDOUR::AsyncMIDIPort> port) FaderPort::midi_input_handler (Glib::IOCondition ioc, boost::weak_ptr<ARDOUR::AsyncMIDIPort> wport)
{ {
boost::shared_ptr<AsyncMIDIPort> port (wport.lock());
if (!port) {
return false;
}
DEBUG_TRACE (DEBUG::FaderPort, string_compose ("something happend on %1\n", boost::shared_ptr<MIDI::Port>(port)->name())); DEBUG_TRACE (DEBUG::FaderPort, string_compose ("something happend on %1\n", boost::shared_ptr<MIDI::Port>(port)->name()));
if (ioc & ~IO_IN) { if (ioc & ~IO_IN) {

View File

@ -178,7 +178,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
PBD::ScopedConnectionList midi_connections; PBD::ScopedConnectionList midi_connections;
bool midi_input_handler (Glib::IOCondition ioc, boost::shared_ptr<ARDOUR::AsyncMIDIPort> port); bool midi_input_handler (Glib::IOCondition ioc, boost::weak_ptr<ARDOUR::AsyncMIDIPort> port);
mutable void *gui; mutable void *gui;
void build_gui (); void build_gui ();