From b7d10f138182b0f2d9b682582f73de8d6ceceb8d Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 18 Mar 2021 11:26:03 +0200 Subject: use single-use attribute for UICommandDescription instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: Ia26871e1a2cf2cc6150d681f3a40b42269fb65c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112686 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../source/uielement/uicommanddescription.cxx | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'framework/source') diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx index d791ddfd89ab..4d9fccf5af41 100644 --- a/framework/source/uielement/uicommanddescription.cxx +++ b/framework/source/uielement/uicommanddescription.cxx @@ -710,33 +710,12 @@ sal_Bool SAL_CALL UICommandDescription::hasElements() } // namespace framework -namespace { - -struct Instance { - explicit Instance( - css::uno::Reference const & context): - instance(static_cast( - new framework::UICommandDescription(context))) - { - } - - css::uno::Reference instance; -}; - -struct Singleton: - public rtl::StaticWithArg< - Instance, css::uno::Reference, Singleton> -{}; - -} - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_framework_UICommandDescription_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - return cppu::acquire(static_cast( - Singleton::get(context).instance.get())); + return cppu::acquire(new framework::UICommandDescription(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit