another attempt to catch details of a rare region-gain undo crash

This commit is contained in:
Ben Loftis 2022-07-16 10:01:21 -05:00
parent 1f65c66727
commit b9419aa405
2 changed files with 7 additions and 0 deletions

View File

@ -3704,6 +3704,8 @@ Editor::abort_reversible_command ()
} }
} }
#include "pbd/stacktrace.h"
void void
Editor::commit_reversible_command () Editor::commit_reversible_command ()
{ {
@ -3716,6 +3718,7 @@ Editor::commit_reversible_command ()
} }
if (before.empty()) { if (before.empty()) {
PBD::stacktrace(cerr, 30);
cerr << "Please call begin_reversible_command() before commit_reversible_command()." << endl; cerr << "Please call begin_reversible_command() before commit_reversible_command()." << endl;
} else { } else {
before.pop_back(); before.pop_back();

View File

@ -3179,6 +3179,10 @@ void
Session::add_command (Command* const cmd) Session::add_command (Command* const cmd)
{ {
assert (_current_trans); assert (_current_trans);
if (!_current_trans) {
error << "Attempted to add an UNDO command without a current transaction. ignoring command (" << cmd->name() << ")" << endl;
return;
}
DEBUG_UNDO_HISTORY ( DEBUG_UNDO_HISTORY (
string_compose ("Current Undo Transaction %1, adding command: %2", string_compose ("Current Undo Transaction %1, adding command: %2",
_current_trans->name (), _current_trans->name (),