diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-28 02:09:58 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-28 02:09:58 +0100 |
commit | 73c5bdd3cb08ad0888fafe2f4018c3f2a575340c (patch) | |
tree | 1c422af893366d737afcee3338df12caf897ae11 /libs/pbd | |
parent | 54911a0ee2a2d81b0587da9932f4dea7e0091dca (diff) |
Fix double free of undo commands (amend 9e6435ff145)
This fixes a case when deleting a plugin, deletes all automation
undo/redo events:
<UndoTransaction name="add automation event">
<MementoCommand type-name="ARDOUR::AutomationList">
...
`delete this;` calls the d'tor which emits drop_references(),
that leads to UndoTransaction::command_death() destroying the
object, whichh causes a double free.
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/pbd/memento_command.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h index 6150ea111d..22b2d4a42d 100644 --- a/libs/pbd/pbd/memento_command.h +++ b/libs/pbd/pbd/memento_command.h @@ -127,7 +127,8 @@ public: } void binder_dying () { - delete this; + /* delegate to UndoTransaction::command_death */ + drop_references (); } void operator() () { |