diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-21 12:31:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-21 14:58:51 +0200 |
commit | 29489b33b435683021b72cb2bce27aba8cb7a430 (patch) | |
tree | 8e4e1c59d56d5ed0d0ca4d088419067041e4553a /unotools/source/config/moduleoptions.cxx | |
parent | a4244c0f05b95ded277a3a7ed217bf0451daa996 (diff) |
loplugin:flatten
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools/source/config/moduleoptions.cxx')
-rw-r--r-- | unotools/source/config/moduleoptions.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx index 35018b8b88c7..e73165ff4b18 100644 --- a/unotools/source/config/moduleoptions.cxx +++ b/unotools/source/config/moduleoptions.cxx @@ -781,18 +781,18 @@ SvtModuleOptions::SvtModuleOptions() { // no need to take the mutex yet, shared_ptr/weak_ptr are thread-safe m_pImpl = g_pModuleOptions.lock(); + if( m_pImpl ) + return; + + // take the mutex, so we don't accidentally create more than one + ::osl::MutexGuard aGuard( impl_GetOwnStaticMutex() ); + + m_pImpl = g_pModuleOptions.lock(); if( !m_pImpl ) { - // take the mutex, so we don't accidentally create more than one - ::osl::MutexGuard aGuard( impl_GetOwnStaticMutex() ); - - m_pImpl = g_pModuleOptions.lock(); - if( !m_pImpl ) - { - m_pImpl = std::make_shared<SvtModuleOptions_Impl>(); - g_pModuleOptions = m_pImpl; - ItemHolder1::holdConfigItem(EItem::ModuleOptions); - } + m_pImpl = std::make_shared<SvtModuleOptions_Impl>(); + g_pModuleOptions = m_pImpl; + ItemHolder1::holdConfigItem(EItem::ModuleOptions); } } |