From ab38826d9005d206600bfc94d6b7b4986480ecce Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 5 Dec 2024 10:20:14 +0100 Subject: [PATCH] vcl a11y: Use comphelper::disposeComponent Change-Id: Ifc63db272484e9a7986e6113989f2f6274f40349 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177846 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/window/menu.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 581279acd8bf..a8c460629dd4 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -199,12 +200,7 @@ void Menu::dispose() } // dispose accessible components - if ( mxAccessible.is() ) - { - css::uno::Reference< css::lang::XComponent> xComponent( mxAccessible, css::uno::UNO_QUERY ); - if ( xComponent.is() ) - xComponent->dispose(); - } + comphelper::disposeComponent(mxAccessible); if ( nEventId ) Application::RemoveUserEvent( nEventId );