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 );