cui/source/options/personalization.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 766c85a4f67f5d50645340e31cebd5956998c6fc
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Mon Jun 4 16:28:22 2018 +0200

    tdf#117866 cui: avoid deadlock in personalization dialog
    
    The deadlock happened as the main thread wanted to join
    SearchAndParseThread (while owning the solar mutex), but
    SearchAndParseThread wanted to take the solar mutex to import a graphic.
    
    Fix the deadlock by checking for the termination flag earlier, so we
    don't take any new mutexes if termination was requested already.
    
    Change-Id: Idddaadadc693610d9f31a14300b22aff8d452756
    Reviewed-on: https://gerrit.libreoffice.org/55284
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/cui/source/options/personalization.cxx 
b/cui/source/options/personalization.cxx
index a4ab78bed8a6..0eb20534931a 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -778,14 +778,16 @@ void SearchAndParseThread::execute()
                 continue;
             }
             INetURLObject aURLObj( sPreviewFile );
+
+            // Stop the thread if requested -- before taking the solar mutex.
+            if( !m_bExecute )
+                return;
+
             // for VCL to be able to create bitmaps / do visual changes in the 
thread
             SolarMutexGuard aGuard;
             aFilter.ImportGraphic( aGraphic, aURLObj );
             BitmapEx aBmp = aGraphic.GetBitmapEx();
 
-            if( !m_bExecute )
-                return;
-
             m_pPersonaDialog->SetImages( Image( aBmp ), nIndex++ );
             m_pPersonaDialog->setOptimalLayoutSize();
             m_pPersonaDialog->AddPersonaSetting( aPersonaSetting );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to