Don't modify a RouteUISelection that we've just erased
[ardour.git] / gtk2_ardour / route_processor_selection.cc
index e66eaf959e868f9d01d3654eb5af4007ab58a11d..8975bf90bcd13fdb953570d0051ca61f83dbd94c 100644 (file)
@@ -124,8 +124,8 @@ RouteProcessorSelection::remove (RouteUI* r)
 
        RouteUISelection::iterator i;
        if ((i = find (routes.begin(), routes.end(), r)) != routes.end()) {
-               routes.erase (i);
                (*i)->set_selected (false);
+               routes.erase (i);
                if (!_no_route_change_signal) {
                        RoutesChanged ();
                }