diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index c72ec8b873..c514aa9861 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3638,6 +3638,8 @@ Session::rename (const std::string& new_name) * already exist ... */ + vector new_session_dirs; + for (vector::const_iterator i = session_dirs.begin(); i != session_dirs.end(); ++i) { vector v; @@ -3660,10 +3662,15 @@ Session::rename (const std::string& new_name) if (Glib::file_test (newstr, Glib::FILE_TEST_EXISTS)) { return -1; } + + space_and_path sp; + sp.path = newstr; + sp.blocks = 0; // not needed + new_session_dirs.push_back(sp); } /* Session dirs */ - + for (vector::const_iterator i = session_dirs.begin(); i != session_dirs.end(); ++i) { vector v; @@ -3719,6 +3726,8 @@ Session::rename (const std::string& new_name) } } + session_dirs = new_session_dirs; + /* state file */ oldstr = Glib::build_filename (newpath, _current_snapshot_name) + statefile_suffix;