summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-01-18 02:10:40 +0000
committerCarl Hetherington <carl@carlh.net>2012-01-18 02:10:40 +0000
commit9237c7411c795ab866e90e7e328300959304b95d (patch)
tree9bd478dcf40c59a48cf2af8eb852dd53cb763814 /libs/ardour/session_state.cc
parentf9a3f741bf8e48e6c92db444bf770a3e80fe8324 (diff)
Catch exception thrown by SMF code when it cannot write
to a file (#4640). git-svn-id: svn://localhost/ardour2/branches/3.0@11259 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 893f94831b..bcc37dde51 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -773,7 +773,11 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
/* tell sources we're saving first, in case they write out to a new file
* which should be saved with the state rather than the old one */
for (SourceMap::const_iterator i = sources.begin(); i != sources.end(); ++i) {
- i->second->session_saved();
+ try {
+ i->second->session_saved();
+ } catch (Evoral::SMF::FileError& e) {
+ error << string_compose ("Could not write to MIDI file %1; MIDI data not saved.", e.file_name ()) << endmsg;
+ }
}
tree.set_root (&get_state());