summaryrefslogtreecommitdiff
path: root/libs/surfaces/faderport
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-12-18 00:07:17 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2016-12-18 00:07:59 +0000
commitecc2348ecc47bd525f7b10b0c2bb87343547d07a (patch)
tree049025404b283c7a3f8fa16b0ece617ecb7de130 /libs/surfaces/faderport
parent1223c8d1cd988c426ea79046b7eb9f542561dcb2 (diff)
should not really bind a shared_ptr<Port> to a sigc slot, so don't do that
Diffstat (limited to 'libs/surfaces/faderport')
-rw-r--r--libs/surfaces/faderport/faderport.cc12
-rw-r--r--libs/surfaces/faderport/faderport.h2
2 files changed, 11 insertions, 3 deletions
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc
index 560be1dc76..3d5baa1348 100644
--- a/libs/surfaces/faderport/faderport.cc
+++ b/libs/surfaces/faderport/faderport.cc
@@ -197,6 +197,8 @@ FaderPort::FaderPort (Session& s)
FaderPort::~FaderPort ()
{
+ cerr << "~FP\n";
+
all_lights_out ();
if (_input_port) {
@@ -247,7 +249,7 @@ FaderPort::start_midi_handling ()
* 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());
}
@@ -749,8 +751,14 @@ FaderPort::connect_session_signals()
}
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()));
if (ioc & ~IO_IN) {
diff --git a/libs/surfaces/faderport/faderport.h b/libs/surfaces/faderport/faderport.h
index 4d5c9702d9..dc9327da2c 100644
--- a/libs/surfaces/faderport/faderport.h
+++ b/libs/surfaces/faderport/faderport.h
@@ -178,7 +178,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
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;
void build_gui ();