summaryrefslogtreecommitdiffstats
path: root/basic
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-06-17 12:00:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-17 13:28:18 +0200
commitd69795b9c9d2dac7b751c6fe8b4663c0c26a129b (patch)
treee900e25a1055aa46c3b54a63bb256a82cba370c6 /basic
parentupdater: detect when user can not write to installation directory (diff)
downloadcore-d69795b9c9d2dac7b751c6fe8b4663c0c26a129b.tar.gz
core-d69795b9c9d2dac7b751c6fe8b4663c0c26a129b.zip
use local statics in getTypes functions
... instead of double checked locking patterns. Change-Id: I1b86ce723ff22dd357b3ed69a52757b085472424 Reviewed-on: https://gerrit.libreoffice.org/38906 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/uno/namecont.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 2e60ea4888b9..0d5a4c1b0e22 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -3130,21 +3130,13 @@ void SfxLibrary::removeByName( const OUString& Name )
// XTypeProvider
Sequence< Type > SfxLibrary::getTypes()
{
- static OTypeCollection * s_pTypes_NameContainer = nullptr;
- if( !s_pTypes_NameContainer )
- {
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- if( !s_pTypes_NameContainer )
- {
- static OTypeCollection s_aTypes_NameContainer(
+ static OTypeCollection ourTypes_NameContainer(
cppu::UnoType<XNameContainer>::get(),
cppu::UnoType<XContainer>::get(),
cppu::UnoType<XChangesNotifier>::get(),
OComponentHelper::getTypes() );
- s_pTypes_NameContainer = &s_aTypes_NameContainer;
- }
- }
- return s_pTypes_NameContainer->getTypes();
+
+ return ourTypes_NameContainer.getTypes();
}