vcl/headless/headlessinst.cxx | 2 -- vcl/ios/iosinst.cxx | 2 -- vcl/source/app/salplug.cxx | 6 ------ vcl/source/app/svmain.cxx | 2 ++ 4 files changed, 2 insertions(+), 10 deletions(-)
New commits: commit e9da6bdabaf2e5b49c78e7ba54243f8f33622b15 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Fri Jan 14 18:28:32 2022 +0100 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Fri Jan 14 19:36:41 2022 +0100 VCL move SolarMutex (un)locking into (De)InitVCL Fixes all the backends, where SolarMutex access needs SalInstance. The ImplSVData::SalInstance is just set fron the return value of CreateSalInstance, so it can't be accessed earlier, globally. Regression from commit ad94bb5d23d9c4ecbb2ca84807f01623862de43e ("VCL drop m_pInstance from *nix SalData). Change-Id: I13259009571a9973ea7e3ded20c0ea4c660ee214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128420 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de> diff --git a/vcl/headless/headlessinst.cxx b/vcl/headless/headlessinst.cxx index a1fa7a78b217..3c47e82333e8 100644 --- a/vcl/headless/headlessinst.cxx +++ b/vcl/headless/headlessinst.cxx @@ -71,13 +71,11 @@ SalInstance *CreateSalInstance() { HeadlessSalInstance* pInstance = new HeadlessSalInstance(std::make_unique<SvpSalYieldMutex>()); new SvpSalData(); - pInstance->AcquireYieldMutex(); return pInstance; } void DestroySalInstance( SalInstance *pInst ) { - pInst->ReleaseYieldMutexAll(); delete pInst; } diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index 3579395924a0..416b53912fec 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -166,13 +166,11 @@ SalInstance *CreateSalInstance() { IosSalInstance* pInstance = new IosSalInstance( std::make_unique<SvpSalYieldMutex>() ); new SvpSalData(pInstance); - pInstance->AcquireYieldMutex(); return pInstance; } void DestroySalInstance( SalInstance *pInst ) { - pInst->ReleaseYieldMutexAll(); delete pInst; } diff --git a/vcl/source/app/salplug.cxx b/vcl/source/app/salplug.cxx index 264e46c7aed1..e56c6dcffb3d 100644 --- a/vcl/source/app/salplug.cxx +++ b/vcl/source/app/salplug.cxx @@ -319,17 +319,11 @@ SalInstance *CreateSalInstance() _exit( 1 ); } - // acquire SolarMutex - pInst->AcquireYieldMutex(); - return pInst; } void DestroySalInstance( SalInstance *pInst ) { - // release SolarMutex - pInst->ReleaseYieldMutexAll(); - delete pInst; #ifndef DISABLE_DYNLOADING if( pCloseModule ) diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 3a9019e006fa..652c7acaad24 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -321,6 +321,7 @@ bool InitVCL() pSVData->mpDefInst = CreateSalInstance(); if ( !pSVData->mpDefInst ) return false; + pSVData->mpDefInst->AcquireYieldMutex(); // Desktop Environment context (to be able to get value of "system.desktop-environment" as soon as possible) css::uno::setCurrentContext( @@ -598,6 +599,7 @@ void DeInitVCL() // Deinit Sal if (pSVData->mpDefInst) { + pSVData->mpDefInst->ReleaseYieldMutexAll(); DestroySalInstance( pSVData->mpDefInst ); pSVData->mpDefInst = nullptr; }