diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-18 11:26:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-20 09:30:57 +0100 |
commit | b7d10f138182b0f2d9b682582f73de8d6ceceb8d (patch) | |
tree | 59f7497436fd18a5ca9dba583a3bcb05bc0ff165 /framework/source | |
parent | 3e12b2fb64350938a3efe3252e84f62aa608356e (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/uielement/uicommanddescription.cxx | 23 |
1 files changed, 1 insertions, 22 deletions
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<css::uno::XComponentContext> const & context): - instance(static_cast<cppu::OWeakObject *>( - new framework::UICommandDescription(context))) - { - } - - css::uno::Reference<css::uno::XInterface> instance; -}; - -struct Singleton: - public rtl::StaticWithArg< - Instance, css::uno::Reference<css::uno::XComponentContext>, Singleton> -{}; - -} - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_framework_UICommandDescription_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(static_cast<cppu::OWeakObject *>( - Singleton::get(context).instance.get())); + return cppu::acquire(new framework::UICommandDescription(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |