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

New commits:
commit e596df57b54bcb4f67dfa1242d47dda0f1e0f6aa
Author: Caolán McNamara <caol...@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();
         }
     }
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to