From 590b4165e85c8ccc460d9da46d272d3dbde37678 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 13 Jun 2022 10:52:31 -0600 Subject: [PATCH] use exception-safe inc/dec in TransportFSM::process_events() Note: the processing guard variable is required because this code could be re-entrant --- libs/ardour/transport_fsm.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/ardour/transport_fsm.cc b/libs/ardour/transport_fsm.cc index 96ca61d820..93517a30af 100644 --- a/libs/ardour/transport_fsm.cc +++ b/libs/ardour/transport_fsm.cc @@ -24,6 +24,7 @@ #include "pbd/error.h" #include "pbd/pthread_utils.h" #include "pbd/stacktrace.h" +#include "pbd/unwind.h" #include "ardour/debug.h" #include "ardour/disk_reader.h" @@ -113,7 +114,7 @@ TransportFSM::hard_stop () void TransportFSM::process_events () { - processing++; + ExceptionSafeIncDec esid (processing); while (!queued_events.empty()) { @@ -172,8 +173,6 @@ TransportFSM::process_events () delete ev; } } - - processing--; } /* This is the transition table from the original boost::msm