summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2022-01-14 18:28:32 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2022-01-14 19:36:41 +0100
commite9da6bdabaf2e5b49c78e7ba54243f8f33622b15 (patch)
tree9d6e7f2278e57f6c8abd83ca2cb498b860e566d1
parentcb4e90c05fb26f37124b5d4bcf15bd1736c05850 (diff)
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 <glogow@fbihome.de>
-rw-r--r--vcl/headless/headlessinst.cxx2
-rw-r--r--vcl/ios/iosinst.cxx2
-rw-r--r--vcl/source/app/salplug.cxx6
-rw-r--r--vcl/source/app/svmain.cxx2
4 files changed, 2 insertions, 10 deletions
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;
}