summaryrefslogtreecommitdiff
path: root/store
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-10 12:36:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-10 12:36:03 +0000
commite596df57b54bcb4f67dfa1242d47dda0f1e0f6aa (patch)
treefd725e15d7d85a67ca975b232fc1ed0840253226 /store
parent322afee279afd6ce5a99212757d0747858959d80 (diff)
valgrind: have MappedLockBytes take complete ownership of the file handle
have MappedLockBytes take complete ownership of the file handle and unmap it and close it on release. Otherwise xFile will close it and MappedLockBytes will unmap it in that order, which breaks post android requirement to have a valid file handle in unmap
Diffstat (limited to 'store')
-rw-r--r--store/source/lockbyte.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index a91e470cc38d..e28bffe48f9d 100644
--- a/store/source/lockbyte.cxx
+++ b/store/source/lockbyte.cxx
@@ -509,6 +509,7 @@ struct FileMapping
static void unmapFile (oslFileHandle hFile, sal_uInt8 * pAddr, sal_uInt32 nSize)
{
(void) osl_unmapMappedFile (hFile, pAddr, nSize);
+ (void) osl_closeFile (hFile);
}
/** @see ResourceHolder<T>::destructor_type
@@ -922,6 +923,7 @@ FileLockBytes_createInstance (
rxLockBytes = new MappedLockBytes (xMapping.get());
if (!rxLockBytes.is())
return store_E_OutOfMemory;
+ (void) xFile.release();
(void) xMapping.release();
}
}