From 6c2773cb0bdafcfc16a48d80153d39778afeb77d Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 11 Apr 2016 14:04:55 -0400 Subject: [PATCH] This really fixes a bug, but only with certain Experimentals enabled... ... and certain other changes too. It is involved in code that makes sure the save of a file with incomplete on-demand loads properly waits for them to finish. It should not really affect production. The experimentals are EXPERIMENTAL_OD_FLAC and EXPERIMENTAL_OD_FFMPEG. --- src/DirManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/DirManager.cpp b/src/DirManager.cpp index ef7fe54db..9c5d3dd47 100644 --- a/src/DirManager.cpp +++ b/src/DirManager.cpp @@ -1145,12 +1145,11 @@ bool DirManager::MoveOrCopyToNewProjectDirectory(BlockFile *f, bool copy) //if it doesn't, we can assume it was written to the NEW name, which is fine. if (oldFileName.FileExists()) { - bool ok = wxCopyFile(oldFileName.GetFullPath(), + auto oldPath = oldFileName.GetFullPath(); + bool ok = wxCopyFile(oldPath, newFileName.GetFullPath()); if(ok && !copy) - // PRL: Is this a bug? Shouldn't it be the old path that - // is removed? - wxRemoveFile(f->GetFileName().GetFullPath()); + wxRemoveFile(oldPath); else if (!ok) return false; }