close all source files before renaming interchange tree in Session::rename()
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 2 Jun 2015 16:08:59 +0000 (12:08 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 2 Jun 2015 16:09:04 +0000 (12:09 -0400)
libs/ardour/session_state.cc

index 1396493ff8681478acf91fa704c69ae04f261831..8bcd892f4deb95e3128240b111693e0e9bb465cd 100644 (file)
@@ -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<FileSource> fs = boost::dynamic_pointer_cast<FileSource> (i->second);
+               if (fs) {
+                       fs->close ();
+               }
+       }
+       
        /* pass one: not 100% safe check that the new directory names don't
         * already exist ...
         */