From f15fc38bd82324e76f69a241179dd0f437fb53dd Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 20 Aug 2017 22:23:10 +0200 Subject: [PATCH] Fix a tiny memory leak --- libs/ardour/session_state.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 287822a6a6..b454c33367 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2417,7 +2417,8 @@ Session::save_template (const string& template_name, const string& description, root = &get_template (); } - root->remove_nodes (X_("description")); + root->remove_nodes_and_delete (X_("description")); + if (!description.empty()) { XMLNode* desc = new XMLNode (X_("description")); XMLNode* desc_cont = new XMLNode (X_("content"), description);