delete session XML object after loading and setting state.

This commit is contained in:
Robin Gareus 2014-09-10 05:18:09 +02:00
parent cab09d87b8
commit d421602c24

View file

@ -1143,7 +1143,7 @@ Session::set_state (const XMLNode& node, int version)
if (node.name() != X_("Session")) { if (node.name() != X_("Session")) {
fatal << _("programming error: Session: incorrect XML node sent to set_state()") << endmsg; fatal << _("programming error: Session: incorrect XML node sent to set_state()") << endmsg;
return -1; goto out;
} }
if ((prop = node.property ("name")) != 0) { 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) { if (_nominal_frame_rate != _current_frame_rate) {
boost::optional<int> r = AskAboutSampleRateMismatch (_nominal_frame_rate, _current_frame_rate); boost::optional<int> r = AskAboutSampleRateMismatch (_nominal_frame_rate, _current_frame_rate);
if (r.get_value_or (0)) { 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 */ StateReady (); /* EMIT SIGNAL */
delete state_tree;
state_tree = 0;
return 0; return 0;
out: out:
delete state_tree;
state_tree = 0;
return ret; return ret;
} }