diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-10 12:36:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-10 12:36:03 +0000 |
commit | e596df57b54bcb4f67dfa1242d47dda0f1e0f6aa (patch) | |
tree | fd725e15d7d85a67ca975b232fc1ed0840253226 /store | |
parent | MAC_WITHOUT_EXT never defined thesedays (diff) | |
download | core-e596df57b54bcb4f67dfa1242d47dda0f1e0f6aa.tar.gz core-e596df57b54bcb4f67dfa1242d47dda0f1e0f6aa.zip |
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.cxx | 2 |
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(); } } |