summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-07-05 00:07:43 +0200
committerMichael Stahl <mstahl@redhat.com>2013-07-05 00:13:46 +0200
commitd68de5195605bd9236851e0714dd9b03b0f5f3be (patch)
tree14b10934cbba3562a80096bac0bfa117458e7bf3 /linguistic
parent3bde0af3a8fd09defd47465d4b62541350cecc1c (diff)
fdo#66420: fix user dictionaries on Windows
28300209604ee1bb8e5050322b29e95a07f679d8 added yet another silly temp file wrapper class, and introduced 2 bugs: the file descriptor is not closed before renaming it which fails with ERROR_SHARING_VIOLATION on Win32, and (as a consequence of that) another attempt to save the dictionary during shutdown fails because SimpleFileAccess cannot be created and this is not checked. Change-Id: I7bd3f5d349ed550440a93fe71e3791c9919de3af
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/dicimp.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 083f4c5cc6bb..5af73a82de33 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -393,7 +393,10 @@ struct TmpDictionary
{
try
{
- mxAccess->kill(maTmpURL);
+ if (mxAccess.is())
+ {
+ mxAccess->kill(maTmpURL);
+ }
}
catch (const uno::Exception &) { }
}
@@ -492,6 +495,8 @@ sal_uLong DictionaryNeo::saveEntries(const OUString &rURL)
break;
}
+ pStream.reset(); // fdo#66420 close streams so Win32 can move the file
+ xStream.clear();
nErr = aTmpDictionary.renameTmpToURL();
//If we are migrating from an older version, then on first successful