Kaydet (Commit) e596df57 authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst 322afee2
...@@ -509,6 +509,7 @@ struct FileMapping ...@@ -509,6 +509,7 @@ struct FileMapping
static void unmapFile (oslFileHandle hFile, sal_uInt8 * pAddr, sal_uInt32 nSize) static void unmapFile (oslFileHandle hFile, sal_uInt8 * pAddr, sal_uInt32 nSize)
{ {
(void) osl_unmapMappedFile (hFile, pAddr, nSize); (void) osl_unmapMappedFile (hFile, pAddr, nSize);
(void) osl_closeFile (hFile);
} }
/** @see ResourceHolder<T>::destructor_type /** @see ResourceHolder<T>::destructor_type
...@@ -922,6 +923,7 @@ FileLockBytes_createInstance ( ...@@ -922,6 +923,7 @@ FileLockBytes_createInstance (
rxLockBytes = new MappedLockBytes (xMapping.get()); rxLockBytes = new MappedLockBytes (xMapping.get());
if (!rxLockBytes.is()) if (!rxLockBytes.is())
return store_E_OutOfMemory; return store_E_OutOfMemory;
(void) xFile.release();
(void) xMapping.release(); (void) xMapping.release();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment