[Libreoffice-commits] core.git: cui/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Jun 28 11:31:06 UTC 2018


 cui/source/options/personalization.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit f4c73f90da2a2c31f0d29572180aa97e10c3dbad
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 28 11:43:35 2018 +0200

    tdf#117866 cui personalization: fix a possible race
    
    The case when the thread is re-scheduled exactly after checking for
    m_bExecute but before taking the solar mutex.
    
    Change-Id: I494c123a6225da60407391771622208c055ae49b
    Reviewed-on: https://gerrit.libreoffice.org/56585
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins

diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index f67c5644f6c5..cf7005b10ee7 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -99,7 +99,13 @@ SelectPersonaDialog::~SelectPersonaDialog()
 void SelectPersonaDialog::dispose()
 {
     if (m_pSearchThread.is())
+    {
+        // Release the solar mutex, so the thread is not affected by the race
+        // when it's after the m_bExecute check but before taking the solar
+        // mutex.
+        SolarMutexReleaser aReleaser;
         m_pSearchThread->join();
+    }
 
     m_pEdit.clear();
     m_pSearchButton.clear();


More information about the Libreoffice-commits mailing list