summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-03-25 12:18:05 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-03-25 15:38:42 +0100
commit47e6bf0109c686f71b48c550667af707705a777b (patch)
tree455fcdf13c23edc29774d8969446f15e768fc8d1 /framework
parentb8720d1e1f0842d52f1830c48ef7551b1868ae6f (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/uielement/menubarmanager.hxx2
-rw-r--r--framework/source/uielement/menubarmanager.cxx16
2 files changed, 5 insertions, 13 deletions
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() )
{