reorder destruction of VCAManager and Routes
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 29 Feb 2016 21:10:31 +0000 (16:10 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:38 +0000 (15:30 -0400)
libs/ardour/session.cc

index 4ff42730ca328b6f95a55a14444df7bf6b70599d..b9dbaa72fdcdef6c95f9d4f6bd102938b97869f8 100644 (file)
@@ -696,6 +696,11 @@ Session::destroy ()
        DEBUG_TRACE (DEBUG::Destruction, "delete regions\n");
        RegionFactory::delete_all_regions ();
 
+       /* Do this early so that VCAs no longer hold references to routes */
+
+       DEBUG_TRACE (DEBUG::Destruction, "delete vcas\n");
+       delete _vca_manager;
+
        DEBUG_TRACE (DEBUG::Destruction, "delete routes\n");
 
        /* reset these three references to special routes before we do the usual route delete thing */
@@ -748,7 +753,6 @@ Session::destroy ()
 
        delete midi_clock;
        delete _tempo_map;
-       delete _vca_manager;
 
        /* clear event queue, the session is gone, nobody is interested in
         * those anymore, but they do leak memory if not removed