From 5965fd15e5865208fed86b406a1950a3b534be83 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 9 Jun 2023 17:23:18 +0200 Subject: [PATCH] Fix tiny memory leak --- libs/ardour/slavable_automation_control.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/ardour/slavable_automation_control.cc b/libs/ardour/slavable_automation_control.cc index 54ee13dba9..1f1d0e43b3 100644 --- a/libs/ardour/slavable_automation_control.cc +++ b/libs/ardour/slavable_automation_control.cc @@ -381,6 +381,9 @@ SlavableAutomationControl::remove_master (std::shared_ptr m) if (*before != *after) { _session.begin_reversible_command (string_compose (_("Merge VCA automation into %1"), name ())); _session.commit_reversible_command (alist()->memento_command (before, after)); + } else { + delete before; + delete after; } } } @@ -455,6 +458,9 @@ SlavableAutomationControl::clear_masters () if (*before != *after) { _session.begin_reversible_command (string_compose (_("Merge VCA automation into %1"), name ())); _session.commit_reversible_command (alist()->memento_command (before, after)); + } else { + delete before; + delete after; } } }