diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 1396493ff8..8bcd892f4d 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3676,6 +3676,17 @@ Session::rename (const std::string& new_name) * Backup files are left unchanged and not renamed. */ + /* Windows requires that we close all files before attempting the + * rename + */ + + for (SourceMap::const_iterator i = sources.begin(); i != sources.end(); ++i) { + boost::shared_ptr fs = boost::dynamic_pointer_cast (i->second); + if (fs) { + fs->close (); + } + } + /* pass one: not 100% safe check that the new directory names don't * already exist ... */