summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-28 02:09:58 +0100
committerRobin Gareus <robin@gareus.org>2020-02-28 02:09:58 +0100
commit73c5bdd3cb08ad0888fafe2f4018c3f2a575340c (patch)
tree1c422af893366d737afcee3338df12caf897ae11 /libs/pbd
parent54911a0ee2a2d81b0587da9932f4dea7e0091dca (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.h3
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() () {