From beaa1b3fcbb2539b59496eaeb926b02372d6c84f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 21 Feb 2021 23:37:45 -0700 Subject: [PATCH] be sure to check the return from the RCU mgr ::update method() inside TempoMap::update() --- libs/temporal/tempo.cc | 8 ++++++-- libs/temporal/temporal/tempo.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index 9b793b8146..8cdb7ee8ad 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -3034,10 +3034,12 @@ TempoMap::init () fetch (); } -void +int TempoMap::update (TempoMap::SharedPtr m) { - _map_mgr.update (m); + if (!_map_mgr.update (m)) { + return -1; + } /* update thread local map pointer in the calling thread */ update_thread_tempo_map (); @@ -3046,6 +3048,8 @@ TempoMap::update (TempoMap::SharedPtr m) _tempo_map_p->dump (cerr); MapChanged (); /* EMIT SIGNAL */ + + return 0; } void diff --git a/libs/temporal/temporal/tempo.h b/libs/temporal/temporal/tempo.h index 4989f5797f..0fb8f30d1b 100644 --- a/libs/temporal/temporal/tempo.h +++ b/libs/temporal/temporal/tempo.h @@ -655,7 +655,7 @@ class LIBTEMPORAL_API TempoMap : public PBD::StatefulDestructible static SharedPtr write_copy() { return _map_mgr.write_copy(); } static void fetch_writable() { _tempo_map_p = write_copy(); } - static void update (SharedPtr m); + static int update (SharedPtr m); static void abort_update (); /* and now on with the rest of the show ... */