From db3e87a7e4576cfa8e999adc26d956150e3d9fa9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 10 Dec 2022 14:14:12 -0700 Subject: [PATCH] do nothing gracefully if asked to remove only tempo --- libs/temporal/tempo.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index 095da87e36..1e00a269cf 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -990,11 +990,13 @@ TempoMap::add_tempo (TempoPoint * tp) void TempoMap::remove_tempo (TempoPoint const & tp) { + if (_tempos.size() < 2) { + return; + } + superclock_t sc (tp.sclock()); Tempos::iterator t; - assert (_tempos.size() > 1); - /* the argument is likely to be a Point-derived object that doesn't * actually exist in this TempoMap, since the caller called * TempoMap::write_copy() in order to perform an RCU operation, but @@ -1621,6 +1623,10 @@ TempoMap::set_meter (Meter const & t, BBT_Time const & bbt) void TempoMap::remove_meter (MeterPoint const & mp) { + if (_meters.size() < 2) { + return; + } + superclock_t sc = mp.sclock(); Meters::iterator m;