summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-04 12:48:59 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-04 11:49:42 +0100
commita2058e7516a01167c2d20ed157500b38db967c64 (patch)
tree375dc0fd109e36bc490ee7e04d2201cee10e4cf2 /chart2
parentb156ca6e4692c2a32f41b9dfcd543966efc64a5d (diff)
replace double-checked locking patterns with thread safe local statics
Change-Id: Ie1aae7ecbd065a88b371d8c0deb586f54f7eff65 Reviewed-on: https://gerrit.libreoffice.org/62835 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx26
1 files changed, 9 insertions, 17 deletions
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index 69004f9bc1c6..9606ae805c6f 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -113,23 +113,15 @@ uno::Any SAL_CALL CreationWizardUnoDlg::queryAggregation( uno::Type const & rTyp
uno::Sequence< uno::Type > CreationWizardUnoDlg::getTypes()
{
- static uno::Sequence< uno::Type > aTypeList;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !aTypeList.getLength() )
- {
- std::vector< uno::Type > aTypes;
- aTypes.push_back( cppu::UnoType<lang::XComponent>::get() );
- aTypes.push_back( cppu::UnoType<lang::XTypeProvider>::get() );
- aTypes.push_back( cppu::UnoType<uno::XAggregation>::get() );
- aTypes.push_back( cppu::UnoType<uno::XWeak>::get() );
- aTypes.push_back( cppu::UnoType<lang::XServiceInfo>::get() );
- aTypes.push_back( cppu::UnoType<lang::XInitialization>::get() );
- aTypes.push_back( cppu::UnoType<frame::XTerminateListener>::get() );
- aTypes.push_back( cppu::UnoType<ui::dialogs::XExecutableDialog>::get() );
- aTypes.push_back( cppu::UnoType<beans::XPropertySet>::get() );
- aTypeList = comphelper::containerToSequence( aTypes );
- }
+ static uno::Sequence<uno::Type> aTypeList{ cppu::UnoType<lang::XComponent>::get(),
+ cppu::UnoType<lang::XTypeProvider>::get(),
+ cppu::UnoType<uno::XAggregation>::get(),
+ cppu::UnoType<uno::XWeak>::get(),
+ cppu::UnoType<lang::XServiceInfo>::get(),
+ cppu::UnoType<lang::XInitialization>::get(),
+ cppu::UnoType<frame::XTerminateListener>::get(),
+ cppu::UnoType<ui::dialogs::XExecutableDialog>::get(),
+ cppu::UnoType<beans::XPropertySet>::get() };
return aTypeList;
}