]> git.lyx.org Git - features.git/commitdiff
Fix bug #7796 (LyX creates file on startup that cannot be deleted)
authorEnrico Forestieri <forenr@lyx.org>
Wed, 28 Sep 2011 07:04:29 +0000 (07:04 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 28 Sep 2011 07:04:29 +0000 (07:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39781 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXRC.cpp
status.20x

index 42116853131c00f87af534f1d48195db135e937e..8c1f75b5dee7f417ffc8a6a4c90f1b9def177643 100644 (file)
@@ -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;
 }
index 70b335930f7822725379ac9ae7efe7f8af66c3a0..ab5a2c561566192cc0440564ab437c2f077b8681 100644 (file)
@@ -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