From d1c695a1a67d2f3d3ac231febf6a57dabe84d17e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 19 Dec 2020 18:30:49 -0700 Subject: [PATCH] fix logic for setting state of tempo map from XML We are using RCU for the tempo map so ... we need to use it --- libs/ardour/session_state.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index c7f5a08e45..94d853fdf7 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1564,8 +1564,9 @@ Session::set_state (const XMLNode& node, int version) goto out; } else { try { - TempoMap::SharedPtr new_map (new TempoMap (*child, version)); - TempoMap::update (new_map); + TempoMap::SharedPtr tmap = TempoMap::write_copy (); /* get writable copy of current tempo map */ + tmap->set_state (*child, version); /* reset its state */ + TempoMap::update (tmap); /* update the global tempo map manager */ } catch (...) { goto out; }