framework/source/uiconfiguration/uiconfigurationmanager.cxx | 33 ++++-------- 1 file changed, 12 insertions(+), 21 deletions(-)
New commits: commit 80ef2a46f4ac2ac6f3b14561a195262156fe4b85 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Dec 5 14:43:30 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Dec 6 07:28:44 2022 +0000 tdf#152134 Customize: assign user macro to menu hangs regression from commit d4257daba1155ebccbfebea99bad0e4152ca9b08 Author: Noel Grandin <noelgran...@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.gran...@collabora.co.uk> 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; } - } + }); } }