push2:small logic fix for destructor, mostly to ensure that the track_mix layout...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 30 Sep 2016 16:07:05 +0000 (11:07 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 30 Sep 2016 16:07:05 +0000 (11:07 -0500)
Otherwise it is still connected to the ControlProtocol::StripableSelectionChanged signal, even though the
event loop specified in the connection has been destroyed.

libs/surfaces/push2/push2.cc

index 9f1290ec094deeb0e30392310d55c9947d7509e9..484dbcccdb6df44b79708807d37e26e3760a3e8a 100644 (file)
@@ -133,9 +133,14 @@ Push2::Push2 (ARDOUR::Session& s)
 
 Push2::~Push2 ()
 {
+       DEBUG_TRACE (DEBUG::Push2, "push2 control surface object being destroyed\n");
+
+       /* do this before stopping the event loop, so that we don't get any notifications */
        selection_connection.disconnect ();
+       port_reg_connection.disconnect ();
+       port_connection.disconnect ();
 
-       stop_event_loop (); /* this will call stop_using_device () in Quit request handler */
+       stop_using_device ();
        device_release ();
        ports_release ();
 
@@ -150,8 +155,13 @@ Push2::~Push2 ()
        scale_layout = 0;
        delete splash_layout;
        splash_layout = 0;
+       delete track_mix_layout;
+       track_mix_layout = 0;
+
+       stop_event_loop ();
 }
 
+
 void
 Push2::run_event_loop ()
 {