diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-17 12:00:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-17 13:28:18 +0200 |
commit | d69795b9c9d2dac7b751c6fe8b4663c0c26a129b (patch) | |
tree | e900e25a1055aa46c3b54a63bb256a82cba370c6 /basic | |
parent | 76ed00f8db34490d5e21c72d142e11da510ac605 (diff) |
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.cxx | 14 |
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(); } |