delete route-groups before flushing routes.
authorRobin Gareus <robin@gareus.org>
Wed, 10 Sep 2014 18:43:30 +0000 (20:43 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 10 Sep 2014 18:43:30 +0000 (20:43 +0200)
libs/ardour/session.cc

index 919b4be28c171cbee1277a169558b1be9a26ef69..fe7fad675f9b04a307c6ef7f4cf031ce55377ed8 100644 (file)
@@ -492,6 +492,11 @@ Session::destroy ()
        delete midi_control_ui;
        delete _all_route_group;
 
+       DEBUG_TRACE (DEBUG::Destruction, "delete route groups\n");
+       for (list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) {
+               delete *i;
+       }
+
        if (click_data != default_click) {
                delete [] click_data;
        }
@@ -557,12 +562,6 @@ Session::destroy ()
                sources.clear ();
        }
 
-       DEBUG_TRACE (DEBUG::Destruction, "delete route groups\n");
-       for (list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) {
-
-               delete *i;
-       }
-
        /* not strictly necessary, but doing it here allows the shared_ptr debugging to work */
        playlists.reset ();