explicitly drop connections from destructor
[ardour.git] / libs / surfaces / launch_control_xl / launch_control_xl.cc
index 6c71559ac40d6406bcd0f9419730da88b6f1f9de..2a4c8ce2d64e3ca1bbaa8aa72e1c13e630611717 100644 (file)
@@ -103,8 +103,8 @@ LaunchControlXL::LaunchControlXL (ARDOUR::Session& s)
        /* Launch Control XL ports might already be there */
        port_registration_handler ();
 
-       session->RouteAdded.connect (session_connections, invalidator(*this), boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
-       session->vca_manager().VCAAdded.connect (session_connections, invalidator (*this), boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
+       session->RouteAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
+       session->vca_manager().VCAAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
 
        switch_bank (bank_start);
 }
@@ -116,6 +116,8 @@ LaunchControlXL::~LaunchControlXL ()
        /* do this before stopping the event loop, so that we don't get any notifications */
        port_reg_connection.disconnect ();
        port_connection.disconnect ();
+       session_connections.drop_connections ();
+       stripable_connections.drop_connections ();
 
        stop_using_device ();
        ports_release ();
@@ -854,12 +856,12 @@ LaunchControlXL::switch_bank (uint32_t base)
                if (stripable[n]) {
                        /* stripable goes away? refill the bank, starting at the same point */
 
-                       stripable[n]->DropReferences.connect (stripable_connections, invalidator (*this), boost::bind (&LaunchControlXL::switch_bank, this, bank_start), lcxl);
-                       stripable[n]->presentation_info().PropertyChanged.connect (stripable_connections, invalidator (*this), boost::bind (&LaunchControlXL::stripable_property_change, this, _1, n), lcxl);
-                       stripable[n]->solo_control()->Changed.connect (stripable_connections, invalidator (*this), boost::bind (&LaunchControlXL::solo_changed, this, n), lcxl);
-                       stripable[n]->mute_control()->Changed.connect (stripable_connections, invalidator (*this), boost::bind (&LaunchControlXL::mute_changed, this, n), lcxl);
+                       stripable[n]->DropReferences.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::switch_bank, this, bank_start), lcxl);
+                       stripable[n]->presentation_info().PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripable_property_change, this, _1, n), lcxl);
+                       stripable[n]->solo_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::solo_changed, this, n), lcxl);
+                       stripable[n]->mute_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::mute_changed, this, n), lcxl);
                        if (stripable[n]->rec_enable_control()) {
-                               stripable[n]->rec_enable_control()->Changed.connect (stripable_connections, invalidator (*this), boost::bind (&LaunchControlXL::rec_changed, this, n), lcxl);
+                               stripable[n]->rec_enable_control()->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::rec_changed, this, n), lcxl);
                        }