summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-12-05 14:43:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-12-06 07:28:44 +0000
commit80ef2a46f4ac2ac6f3b14561a195262156fe4b85 (patch)
tree570e0194a8ca46691b6a1e64bafba770270c6eb9 /framework
parent76141ec7db4c26a112f0e9815d333cd70e1c4258 (diff)
tdf#152134 Customize: assign user macro to menu hangs
regression from commit d4257daba1155ebccbfebea99bad0e4152ca9b08 Author: Noel Grandin <noelgrandin@gmail.com> Date: Fri Dec 24 20:58:28 2021 +0200 use comphelper::WeakComponentImplHelper in MenuBarManager We should not hold the mutex while firing events, since the mutex is now non-recursive. Change-Id: I6ee45df0bf27df3ca1fd31857285ceb820161d61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143671 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx33
1 files changed, 12 insertions, 21 deletions
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index eeb1418da1c3..4950cbfc4cf3 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -1347,29 +1347,20 @@ sal_Bool SAL_CALL UIConfigurationManager::isReadOnly()
void UIConfigurationManager::implts_notifyContainerListener( const ConfigurationEvent& aEvent, NotifyOp eOp )
{
std::unique_lock aGuard(m_mutex);
- comphelper::OInterfaceIteratorHelper4 pIterator( aGuard, m_aConfigListeners );
- while ( pIterator.hasMoreElements() )
- {
- try
- {
- switch ( eOp )
- {
- case NotifyOp_Replace:
- pIterator.next()->elementReplaced( aEvent );
- break;
- case NotifyOp_Insert:
- pIterator.next()->elementInserted( aEvent );
- break;
- case NotifyOp_Remove:
- pIterator.next()->elementRemoved( aEvent );
- break;
- }
- }
- catch( const css::uno::RuntimeException& )
+ m_aConfigListeners.forEach(aGuard, [&eOp, &aEvent](const css::uno::Reference<XUIConfigurationListener>& l) {
+ switch ( eOp )
{
- pIterator.remove(aGuard);
+ case NotifyOp_Replace:
+ l->elementReplaced( aEvent );
+ break;
+ case NotifyOp_Insert:
+ l->elementInserted( aEvent );
+ break;
+ case NotifyOp_Remove:
+ l->elementRemoved( aEvent );
+ break;
}
- }
+ });
}
}