oox/source/core/filterbase.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit eb2fec9480002551116c5b9a793bdced1f27bdcf
Author:     Vasily Melenchuk <vasily.melenc...@cib.de>
AuthorDate: Sun Oct 13 21:29:24 2019 +0300
Commit:     Vasily Melenchuk <vasily.melenc...@cib.de>
CommitDate: Mon Nov 18 10:27:12 2019 +0300

    oox: avoid control freeze on exception
    
    If exception happens somewhere in exportDocument() or later,
    document controls could be remain locked and later cause crash
    due to missing exception handler.
    
    Use scope guard to avoid this problem on exception.
    
    (cherry picked from commit ce684e7d06fc37ac6b672f5676e6113fcf41a03e)
    
    Change-Id: I1ce4e487833ddc4b1f1b708f3a7e10bb299ef354
    Reviewed-on: https://gerrit.libreoffice.org/80752
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index ca57d3920a0c..a42390d97ef7 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -30,6 +30,7 @@
 #include <cppuhelper/supportsservice.hxx>
 #include <comphelper/documentconstants.hxx>
 #include <comphelper/sequence.hxx>
+#include <comphelper/scopeguard.hxx>
 #include <unotools/mediadescriptor.hxx>
 #include <osl/mutex.hxx>
 #include <osl/diagnose.h>
@@ -475,7 +476,11 @@ sal_Bool SAL_CALL FilterBase::filter( const Sequence< 
PropertyValue >& rMediaDes
     DocumentOpenedGuard aOpenedGuard( mxImpl->maFileUrl );
     if( aOpenedGuard.isValid() || mxImpl->maFileUrl.isEmpty() )
     {
-        ControllerLockGuard aCtrlLockGuard(mxImpl->mxModel);
+        Reference<XModel> xTempModel = mxImpl->mxModel;
+        xTempModel->lockControllers();
+        comphelper::ScopeGuard const lockControllersGuard([xTempModel]() {
+            xTempModel->unlockControllers();
+        });
 
         switch( mxImpl->meDirection )
         {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to