framework/inc/uielement/menubarmanager.hxx | 2 -- framework/source/uielement/menubarmanager.cxx | 16 +++++----------- 2 files changed, 5 insertions(+), 13 deletions(-)
New commits: commit 47e6bf0109c686f71b48c550667af707705a777b Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Fri Mar 25 12:18:05 2022 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Mar 25 15:38:42 2022 +0100 Fold MenuBarManager::Destroy into its only call site ...mainly to demonstrate that its SolarMutexGuard was redundant and that replacing it with DBG_TESTSOLARMUTEX() would be overkill Change-Id: I82f00873cd99cb5da1b644c40ba25f8c210503cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132112 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx index 079d127d4d83..710c788f2dcc 100644 --- a/framework/inc/uielement/menubarmanager.hxx +++ b/framework/inc/uielement/menubarmanager.hxx @@ -127,8 +127,6 @@ class MenuBarManager final : static bool MustBeHidden( PopupMenu* pPopupMenu, const css::uno::Reference< css::util::XURLTransformer >& rTransformer ); OUString RetrieveLabelFromCommand(const OUString& rCmdURL); - void Destroy(); - struct MenuItemHandler { MenuItemHandler( sal_uInt16 aItemId, diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 49b4092f6d46..c363ccffb9b6 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -136,9 +136,12 @@ MenuBarManager::~MenuBarManager() SAL_WARN_IF( OWeakObject::m_refCount != 0, "fwk.uielement", "Who wants to delete an object with refcount > 0!" ); } -void MenuBarManager::Destroy() +// XComponent +void MenuBarManager::disposing(std::unique_lock<std::mutex>& ) { - SolarMutexGuard aGuard; + Reference< XComponent > xThis( this ); + + SolarMutexGuard g; // stop asynchronous settings timer and // release deferred item container reference @@ -152,15 +155,6 @@ void MenuBarManager::Destroy() { m_pVCLMenu.disposeAndClear(); } -} - -// XComponent -void MenuBarManager::disposing(std::unique_lock<std::mutex>& ) -{ - Reference< XComponent > xThis( this ); - - SolarMutexGuard g; - Destroy(); if ( m_xDocImageManager.is() ) {