diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index ad4473bd87..758c2b609a 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -548,21 +549,10 @@ Session::remove_state (string snapshot_name) xml_path /= snapshot_name + statefile_suffix; - sys::path backup_path(xml_path.to_string() + backup_suffix); - - // make a backup copy of the state file - if (sys::exists (xml_path)) { - try - { - sys::copy_file (xml_path, backup_path); - } - catch(sys::filesystem_error& ex) - { - error << string_compose (_("Not removing state file %1 because a backup could not be made (%2)"), - xml_path.to_string(), ex.what()) - << endmsg; - return; - } + if (!create_backup_file (xml_path)) { + // don't remove it if a backup can't be made + // create_backup_file will log the error. + return; } // and delete it