From e596df57b54bcb4f67dfa1242d47dda0f1e0f6aa Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 10 Jan 2012 12:36:03 +0000 Subject: 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 --- store/source/lockbyte.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'store') 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::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(); } } -- cgit