summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-01-03 18:08:11 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-01-03 18:08:11 +0000
commitca81401b14782b5d13905732778e6bf9b5f5f2ae (patch)
treebf4c346b8cdb8bbdf86e8ba0f0efc80c87d4adc3 /libs/ardour/session_state.cc
parentb5f497c0c98501cf6a9deff7593e286613b7dc0c (diff)
massive changes to clean up what happens during session destruction when an exception is thrown
git-svn-id: svn://localhost/ardour2/trunk@1261 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 0afa682d58..0c2961c82a 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -99,12 +99,14 @@ void
Session::first_stage_init (string fullpath, string snapshot_name)
{
if (fullpath.length() == 0) {
+ destroy ();
throw failed_constructor();
}
char buf[PATH_MAX+1];
if (!realpath (fullpath.c_str(), buf) && (errno != ENOENT)) {
error << string_compose(_("Could not use path %1 (%s)"), buf, strerror(errno)) << endmsg;
+ destroy ();
throw failed_constructor();
}
@@ -155,7 +157,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
_worst_output_latency = 0;
_worst_input_latency = 0;
_worst_track_latency = 0;
- _state_of_the_state = StateOfTheState(CannotSave|InitialConnecting|Loading);
+ _state_of_the_state = StateOfTheState(CannotSave|InitialConnecting|Loading|Deletion);
_slave = 0;
butler_mixdown_buffer = 0;
butler_gain_buffer = 0;
@@ -307,7 +309,13 @@ Session::second_stage_init (bool new_session)
_engine.Halted.connect (mem_fun (*this, &Session::engine_halted));
_engine.Xrun.connect (mem_fun (*this, &Session::xrun_recovery));
- when_engine_running();
+ try {
+ when_engine_running();
+ }
+
+ catch (...) {
+ return -1;
+ }
send_full_time_code ();
_engine.transport_locate (0);