From c44d692390d69e14cac2792149aa34b2ce8cea36 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Tue, 3 May 2022 07:57:20 -0500 Subject: [PATCH] Create a trap for overlapping or nested undo commands --- libs/ardour/session_state.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 214cdf4f18..cb88d24107 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3161,6 +3161,14 @@ Session::begin_reversible_command (const string& name) void Session::begin_reversible_command (GQuark q) { + if (_current_trans) { + cerr << "An UNDO transaction was started while a prior command was underway. Aborting command (" << g_quark_to_string (q) << ") and prior (" << _current_trans->name() << ")" << endl; + PBD::warning << "An UNDO transaction was started while a prior command was underway. Aborting command (" << g_quark_to_string (q) << ") and prior (" << _current_trans->name() << ")" << endmsg; + abort_reversible_command(); + assert (false); + return; + } + /* If nested begin/commit pairs are used, we create just one UndoTransaction to hold all the commands that are committed. This keeps the order of commands correct in the history.