summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-06-28 11:43:35 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-06-28 17:13:16 +0200
commitea08ffc92d84e944a143902f9cd280370986a781 (patch)
treed651cfab3af631b5dc0032210ad5a5ce6d73c4b1 /cui
parent0f530cb9fb086e058ba2946e8f956b33924e82f4 (diff)
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. (cherry picked from commit f4c73f90da2a2c31f0d29572180aa97e10c3dbad) Change-Id: I494c123a6225da60407391771622208c055ae49b Reviewed-on: https://gerrit.libreoffice.org/56593 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/personalization.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 7b4cf6807170..216bc6e8e935 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();