fix logic when removing routes
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 8 May 2017 09:56:24 +0000 (10:56 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 8 May 2017 09:56:24 +0000 (10:56 +0100)
Selection change and re-order signals are distinct.

libs/ardour/session.cc

index 1c72b8042ad07b2778fe1a2e9ddb692aaae6290e..07c6bbb04242e30166fbc2f18cfdb368b5372309 100644 (file)
@@ -3825,22 +3825,23 @@ Session::remove_routes (boost::shared_ptr<RouteList> routes_to_remove)
 
        routes.flush ();
 
-       /* try to cause everyone to drop their references
-        * and unregister ports from the backend
+       /* remove these routes from the selection if appropriate, and signal
+        * the change *before* we call DropReferences for them.
         */
 
        if (send_selected && !deletion_in_progress()) {
                for (RouteList::iterator iter = routes_to_remove->begin(); iter != routes_to_remove->end(); ++iter) {
                        _selection->remove_stripable_by_id ((*iter)->id());
                }
-               PropertyChange so;
-               so.add (Properties::order);
-               if (send_selected) {
-                       so.add (Properties::selected);
-               }
-               PresentationInfo::Change (so);
+               PropertyChange pc;
+               pc.add (Properties::selected);
+               PresentationInfo::Change (pc);
        }
 
+       /* try to cause everyone to drop their references
+        * and unregister ports from the backend
+        */
+
        for (RouteList::iterator iter = routes_to_remove->begin(); iter != routes_to_remove->end(); ++iter) {
                (*iter)->drop_references ();
        }
@@ -3849,6 +3850,9 @@ Session::remove_routes (boost::shared_ptr<RouteList> routes_to_remove)
                return;
        }
 
+       PropertyChange pc;
+       pc.add (Properties::selected);
+       PresentationInfo::Change (pc);
 
        /* save the new state of the world */