summaryrefslogtreecommitdiff
path: root/stoc/source/corereflection/crefl.cxx
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-06-15 21:18:54 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2018-06-15 22:20:55 +0200
commit02a7f9e15a46ead2892f54b9e891a32eeef52deb (patch)
tree164e62bec0b97b9aa786dd5f203426c1ea7cbc45 /stoc/source/corereflection/crefl.cxx
parent1b897f16e3ab45d87fe34011fa3bdb2a1680901c (diff)
stoc: replace double-checked locking with static initializers
Change-Id: I2a36033d0377a58dc27564e903e2c7ce02696206 Reviewed-on: https://gerrit.libreoffice.org/55900 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'stoc/source/corereflection/crefl.cxx')
-rw-r--r--stoc/source/corereflection/crefl.cxx22
1 files changed, 7 insertions, 15 deletions
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx
index d7d59c769dcc..6d02a8b9bf37 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -82,21 +82,13 @@ void IdlReflectionServiceImpl::release() throw()
Sequence< Type > IdlReflectionServiceImpl::getTypes()
{
- static OTypeCollection * s_pTypes = nullptr;
- if (! s_pTypes)
- {
- MutexGuard aGuard( _aComponentMutex );
- if (! s_pTypes)
- {
- static OTypeCollection s_aTypes(
- cppu::UnoType<XIdlReflection>::get(),
- cppu::UnoType<XHierarchicalNameAccess>::get(),
- cppu::UnoType<XServiceInfo>::get(),
- OComponentHelper::getTypes() );
- s_pTypes = &s_aTypes;
- }
- }
- return s_pTypes->getTypes();
+ static OTypeCollection s_aTypes(
+ cppu::UnoType<XIdlReflection>::get(),
+ cppu::UnoType<XHierarchicalNameAccess>::get(),
+ cppu::UnoType<XServiceInfo>::get(),
+ OComponentHelper::getTypes() );
+
+ return s_aTypes.getTypes();
}
Sequence< sal_Int8 > IdlReflectionServiceImpl::getImplementationId()