Kaydet (Commit) 336d91a6 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#113377 cui personalization: fix calling into VCL without necessary locking

We assume the SolarMutex is always taken when doing GL calls, but
putting DBG_TESTSOLARMUTEX() into WinOpenGLContext::makeCurrent()
pointed out two places in the persona code where this invariant wasn't
hold, fix those.

Opening the dialog and downloading previews of one category, then
clicking on an other button to download previews of an other category no
longer results in a crash while calling glBindFramebuffer() with this.

Change-Id: Ib8148a709f89c2dc44da102e2023cc61ba890744
Reviewed-on: https://gerrit.libreoffice.org/53414Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 697ebd15
......@@ -252,6 +252,8 @@ void SelectPersonaDialog::AddPersonaSetting( OUString const & rPersonaSetting )
void SelectPersonaDialog::ClearSearchResults()
{
// for VCL to be able to destroy bitmaps
SolarMutexGuard aGuard;
m_vPersonaSettings.clear();
m_aSelectedPersona.clear();
for(VclPtr<PushButton> & nIndex : m_vResultList)
......@@ -776,14 +778,14 @@ void SearchAndParseThread::execute()
continue;
}
INetURLObject aURLObj( sPreviewFile );
// for VCL to be able to create bitmaps / do visual changes in the thread
SolarMutexGuard aGuard;
aFilter.ImportGraphic( aGraphic, aURLObj );
Bitmap aBmp = aGraphic.GetBitmap();
if( !m_bExecute )
return;
// for VCL to be able to do visual changes in the thread
SolarMutexGuard aGuard;
m_pPersonaDialog->SetImages( Image( aBmp ), nIndex++ );
m_pPersonaDialog->setOptimalLayoutSize();
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