diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-07 19:42:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-08 09:01:42 +0200 |
commit | e4f6840d0968ff9ea8976fdd735e1ecfe266cdde (patch) | |
tree | b6c45864f12504ef1da180a38ebb0872c52d268b /framework/source/layoutmanager | |
parent | 93d6a7ca515909c657224cb2f8d5397c376b8017 (diff) |
framework: replace double checked locking patterns
with thread safe local statics.
Change-Id: I660f6a899d1821bab627ed4972c4fc0d40610de2
Reviewed-on: https://gerrit.libreoffice.org/38541
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/layoutmanager')
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 8cc14fddf5ee..14364f7c6c2b 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -3109,20 +3109,9 @@ namespace uno::Reference< beans::XPropertySetInfo > SAL_CALL LayoutManager::getPropertySetInfo() { - static uno::Reference< beans::XPropertySetInfo >* pInfo = nullptr; + static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); - if( pInfo == nullptr ) - { - osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ); - - if( pInfo == nullptr ) - { - static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); - pInfo = &xInfo; - } - } - - return (*pInfo); + return xInfo; } } // namespace framework |