From 4b28e4ee3ce622683b0c967d715116fb84441cc3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 28 Feb 2020 06:06:44 +0100 Subject: Fix some recursive undo removal ~StatefulDiffCommand() may trigger UndoTransaction::command_death() which may delete the StatefulDiffCommand() that's just being destroyed. This depends on the signal-connection order, which is undefined. In any case when a shared_ptr<> object is being destroyed it means that all references to it are already gone. There's no need to emit drop_references from the d'tor. --- libs/pbd/pbd/memento_command.h | 1 - libs/pbd/stateful_diff_command.cc | 2 -- 2 files changed, 3 deletions(-) (limited to 'libs/pbd') diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h index 22b2d4a42d..72d0228b6c 100644 --- a/libs/pbd/pbd/memento_command.h +++ b/libs/pbd/pbd/memento_command.h @@ -120,7 +120,6 @@ public: } ~MementoCommand () { - drop_references (); delete before; delete after; delete _binder; diff --git a/libs/pbd/stateful_diff_command.cc b/libs/pbd/stateful_diff_command.cc index 6236d6b53e..48ea675179 100644 --- a/libs/pbd/stateful_diff_command.cc +++ b/libs/pbd/stateful_diff_command.cc @@ -68,8 +68,6 @@ StatefulDiffCommand::StatefulDiffCommand (boost::shared_ptr