From d421602c2475c6842cbef757bb647d8f19485e9d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 10 Sep 2014 05:18:09 +0200 Subject: [PATCH] delete session XML object after loading and setting state. --- libs/ardour/session_state.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 0c7cfbc857..96f0e55199 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1143,7 +1143,7 @@ Session::set_state (const XMLNode& node, int version) if (node.name() != X_("Session")) { fatal << _("programming error: Session: incorrect XML node sent to set_state()") << endmsg; - return -1; + goto out; } if ((prop = node.property ("name")) != 0) { @@ -1157,7 +1157,7 @@ Session::set_state (const XMLNode& node, int version) if (_nominal_frame_rate != _current_frame_rate) { boost::optional r = AskAboutSampleRateMismatch (_nominal_frame_rate, _current_frame_rate); if (r.get_value_or (0)) { - return -1; + goto out; } } } @@ -1350,9 +1350,13 @@ Session::set_state (const XMLNode& node, int version) StateReady (); /* EMIT SIGNAL */ + delete state_tree; + state_tree = 0; return 0; out: + delete state_tree; + state_tree = 0; return ret; }