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>
(cherry picked from commit 80ef2a46f4ac2ac6f3b14561a195262156fe4b85)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143591
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 42f6269..24dbe16 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -1348,29 +1348,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
m_aConfigListeners.forEach(aGuard, [&eOp, &aEvent](const css::uno::Reference<XUIConfigurationListener>& l) {
switch ( eOp )
{
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;
}
case NotifyOp_Replace:
l->elementReplaced( aEvent );
break;
case NotifyOp_Insert:
l->elementInserted( aEvent );
break;
case NotifyOp_Remove:
l->elementRemoved( aEvent );
break;
}
catch( const css::uno::RuntimeException& )
{
pIterator.remove(aGuard);
}
}
});
}
}