Don't clear clipboard unnecessarily in ProjectFileManager::Compact()

This commit is contained in:
Paul Licameli 2020-11-17 17:13:17 -05:00
parent 716139494d
commit ea76b7c9f7
1 changed files with 3 additions and 2 deletions

View File

@ -1265,8 +1265,9 @@ void ProjectFileManager::Compact()
auto numStates = undoManager.GetNumStates();
undoManager.RemoveStates(0, numStates - 1);
// And clear the clipboard
clipboard.Clear();
// And clear the clipboard, if needed
if (&mProject == clipboard.Project().lock().get())
clipboard.Clear();
// Refresh the before space usage since it may have changed due to the
// above actions.