[Libreoffice-commits] .: store/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue Jan 10 04:38:05 PST 2012


 store/source/lockbyte.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit e596df57b54bcb4f67dfa1242d47dda0f1e0f6aa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 10 12:36:03 2012 +0000

    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

diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index a91e470..e28bffe 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();
         }
     }


More information about the Libreoffice-commits mailing list