13
0

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.
This commit is contained in:
Paul Davis 2021-11-13 07:51:12 -07:00
parent 4d5cf43789
commit 8a59f3fe8e

View File

@ -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);
}