Kaydet (Commit) 766c85a4 authored tarafından Miklos Vajna's avatar Miklos Vajna

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/55284Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 710ba434
...@@ -778,14 +778,16 @@ void SearchAndParseThread::execute() ...@@ -778,14 +778,16 @@ void SearchAndParseThread::execute()
continue; continue;
} }
INetURLObject aURLObj( sPreviewFile ); 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 // for VCL to be able to create bitmaps / do visual changes in the thread
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
aFilter.ImportGraphic( aGraphic, aURLObj ); aFilter.ImportGraphic( aGraphic, aURLObj );
BitmapEx aBmp = aGraphic.GetBitmapEx(); BitmapEx aBmp = aGraphic.GetBitmapEx();
if( !m_bExecute )
return;
m_pPersonaDialog->SetImages( Image( aBmp ), nIndex++ ); m_pPersonaDialog->SetImages( Image( aBmp ), nIndex++ );
m_pPersonaDialog->setOptimalLayoutSize(); m_pPersonaDialog->setOptimalLayoutSize();
m_pPersonaDialog->AddPersonaSetting( aPersonaSetting ); m_pPersonaDialog->AddPersonaSetting( aPersonaSetting );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment