From 0b89d69de127fd17237006f03417a6129365f3c8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 17 Jul 2020 15:22:40 +0200 Subject: [PATCH] Copy state files for backup, instead of serializing This should speed up backup saves of large session files. --- libs/ardour/session_state.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 8c7ccb2c53..5af5f1954d 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -925,9 +925,10 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot save_path += "-"; save_path += timebuf; save_path += statefile_suffix; - if ( !tree.write (save_path) ) + if (!copy_file (xml_path, save_path)) { error << string_compose(_("Could not save backup file at path \"%1\" (%2)"), save_path, g_strerror (errno)) << endmsg; + } } StateSaved (snapshot_name); /* EMIT SIGNAL */