fix crash when switching from regular MIDI to ipMIDI Mackie surface
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 8 Oct 2015 19:28:21 +0000 (15:28 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 8 Oct 2015 19:28:21 +0000 (15:28 -0400)
libs/surfaces/mackie/surface.cc

index 5551c5d0de6bed741c78d52d039a409b836bf0ab..5ee2e81abd0a57c04a487a16ab2382b826468f87 100644 (file)
@@ -150,6 +150,8 @@ Surface::~Surface ()
                delete *it;
        }
 
+       port_connection.disconnect ();
+
        delete _jog_wheel;
        delete _port;
 
@@ -159,6 +161,10 @@ Surface::~Surface ()
 void
 Surface::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool yn)
 {
+       if (!_port) {
+               return;
+       }
+
        string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (_port->input_name());
        string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (_port->output_name());