summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-09-10 05:18:09 +0200
committerRobin Gareus <robin@gareus.org>2014-09-10 05:18:09 +0200
commitd421602c2475c6842cbef757bb647d8f19485e9d (patch)
tree416290ebc6c19eff5a4f0817db89294a6ec17639 /libs
parentcab09d87b8b660e6d2a6169346d30c1629d59bbb (diff)
delete session XML object after loading and setting state.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session_state.cc8
1 files 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<int> 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;
}