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 */
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