summaryrefslogtreecommitdiff
path: root/stoc/source/corereflection/crarray.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/crarray.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/crarray.cxx')
-rw-r--r--stoc/source/corereflection/crarray.cxx18
1 files changed, 5 insertions, 13 deletions
diff --git a/stoc/source/corereflection/crarray.cxx b/stoc/source/corereflection/crarray.cxx
index 4bdfa4867054..1c6b1692aab1 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -52,19 +52,11 @@ void ArrayIdlClassImpl::release() throw()
Sequence< Type > ArrayIdlClassImpl::getTypes()
{
- static ::cppu::OTypeCollection * s_pTypes = nullptr;
- if (! s_pTypes)
- {
- ::osl::MutexGuard aGuard( getMutexAccess() );
- if (! s_pTypes)
- {
- static ::cppu::OTypeCollection s_aTypes(
- cppu::UnoType<XIdlArray>::get(),
- IdlClassImpl::getTypes() );
- s_pTypes = &s_aTypes;
- }
- }
- return s_pTypes->getTypes();
+ static cppu::OTypeCollection s_aTypes(
+ cppu::UnoType<XIdlArray>::get(),
+ IdlClassImpl::getTypes() );
+
+ return s_aTypes.getTypes();
}
Sequence< sal_Int8 > ArrayIdlClassImpl::getImplementationId()