diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-05-05 21:00:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-07 08:00:46 +0200 |
commit | 31e2b4746a4a5d7661c4aa8f6a4489e50982aede (patch) | |
tree | 51b30c8370df279acd636e599028d01b72cab5f1 /framework/source/uiconfiguration | |
parent | 50deb478e97aa9cfd023c5fa2f9d567b0b5797c2 (diff) |
improve some usage of OInterfaceIteratorHelper4
we can drop the lock immediately after construction (since
the iterator holds a thread-safe COW link to the underlying listener
container)
Change-Id: I08f8fa9ed7393747938572097f3c25f5f3f847fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151440
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/uiconfiguration')
-rw-r--r-- | framework/source/uiconfiguration/imagemanagerimpl.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index 26aa0f33400c..0152387cc0b4 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -1169,6 +1169,7 @@ void ImageManagerImpl::implts_notifyContainerListener( const ConfigurationEvent& { std::unique_lock aGuard(m_mutex); comphelper::OInterfaceIteratorHelper4 pIterator( aGuard, m_aConfigListeners ); + aGuard.unlock(); while ( pIterator.hasMoreElements() ) { try @@ -1188,7 +1189,9 @@ void ImageManagerImpl::implts_notifyContainerListener( const ConfigurationEvent& } catch( const css::uno::RuntimeException& ) { + aGuard.lock(); pIterator.remove(aGuard); + aGuard.unlock(); } } } |