diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index 4211685313..8c1f75b5de 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -402,11 +402,15 @@ bool LyXRC::read(FileName const & filename, bool check_format) LYXERR0 ("Unable to convert " << filename.absFileName() << " to format " << LYXRC_FILEFORMAT); return false; + } else { + // Keep this in the else branch, such that lexrc2 goes out + // of scope and releases the lock on tempfile before we + // attempt to remove it. This matters on Windows. + Lexer lexrc2(lyxrcTags); + lexrc2.setFile(tempfile); + LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'..."); + retval = read(lexrc2, check_format); } - Lexer lexrc2(lyxrcTags); - lexrc2.setFile(tempfile); - LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'..."); - retval = read(lexrc2, check_format); tempfile.removeFile(); return retval == ReadOK; } diff --git a/status.20x b/status.20x index 70b335930f..ab5a2c5615 100644 --- a/status.20x +++ b/status.20x @@ -86,6 +86,9 @@ What's new - Fix whitespace issues with language changes (bug 7607). +- Fix deletion of temporary file used for preferences conversion on + Windows (bug 7796). + * USER INTERFACE