From d69795b9c9d2dac7b751c6fe8b4663c0c26a129b Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Sat, 17 Jun 2017 12:00:17 +0200 Subject: 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 Reviewed-by: Noel Grandin --- basic/source/uno/namecont.cxx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'basic') 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::get(), cppu::UnoType::get(), cppu::UnoType::get(), OComponentHelper::getTypes() ); - s_pTypes_NameContainer = &s_aTypes_NameContainer; - } - } - return s_pTypes_NameContainer->getTypes(); + + return ourTypes_NameContainer.getTypes(); } -- cgit