Crash immediately after restore loses file paths

• Feb 1, 2016 - 17:54
Graphical (UI)
S4 - Minor

Running V2.0.2 on Windows 7. (I'm using this known bug: in V2.0.2 to cause crashes.)

Problem: After two or more session restores in quick succession, file names of open scores are incorrect.

Steps to reproduce: Crash MuseScore with more than one score open. Restart and restore session. Active scores reappear. Immediately crash MuseScore again.

Restart again and restore session. The scores reappear, but the file names are no longer correct. Saving an open score now updates the wrong location; to save properly you must navigate back to the original file and overwrite it.

Several different sorts of incorrect names may appear, depending on how many crashes have occurred: the full path to the original score with "\" replaced by "_"; an 8-character name starting with "sc" (probably a MuseScore internal file name), or a full path name to the "sc" file in the user's roaming folder with "\" replaced by "_".

Irritatingly, these useless file names get added to the "Open Recent" list if you simply close them (as you would if a particular score had no unsaved changes).

My best guess: When restoring a session MuseScore loads scores from its internal files and links them in its internal "system state" to the true path to the user's files. But those links aren't recorded until the next time MuseScore does an automatic save. So a crash / restore / crash sequence leaves MuseScore with good backup files but incorrect file paths. Perhaps MuseScore should do an automatic save immediately after a crash restore.

I haven't checked the latest nightly build, because I don't know how to make it crash on demand.