From 8a59f3fe8e81fc648a1348ccfb649e49edef3c8c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 13 Nov 2021 07:51:12 -0700 Subject: [PATCH] temporal: fix issue with removal of tempo, meter and bartime points The correct algorithm is to traverse the type-specific list of points, find the point (if any) whose time matches that of the argument (because we do not allow multiple points of the same type at the same time), and then use that discovered point from the _points list. This approach is required because the actual argument may no longer be in the tempo map (due to a change made by another thread). The lack of sync, however, needs investigation. --- libs/temporal/tempo.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index e945c89ff6..eb8199f562 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -943,7 +943,7 @@ TempoMap::remove_tempo (TempoPoint const & tp) return; } _tempos.erase (t); - remove_point (tp); + remove_point (*t); reset_starting_at (sc); } @@ -1018,7 +1018,7 @@ TempoMap::remove_bartime (MusicTimePoint const & tp) } _bartimes.erase (m); - remove_point (tp); + remove_point (*m); reset_starting_at (sc); } @@ -1484,7 +1484,7 @@ TempoMap::remove_meter (MeterPoint const & mp) return; } _meters.erase (m); - remove_point (mp); + remove_point (*m); reset_starting_at (sc); }