diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-18 11:28:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-20 09:30:20 +0100 |
commit | 8a6887717f4f667ff3621e98379e62e0d57a4a3a (patch) | |
tree | f5407996dd1c25998f00fb74c61527d71970b043 /framework | |
parent | 6fa6e19fdca29752492a5230b2a948075a347c87 (diff) |
use single-use attribute for UICategoryDescription
instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down
Change-Id: Ie6c8f76b88f1e059b81b28a40343a2207531b0d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112688
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uiconfiguration/uicategorydescription.cxx | 19 | ||||
-rw-r--r-- | framework/util/fwk.component | 3 |
2 files changed, 3 insertions, 19 deletions
diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx b/framework/source/uiconfiguration/uicategorydescription.cxx index 279b8b7fd192..218032c5238e 100644 --- a/framework/source/uiconfiguration/uicategorydescription.cxx +++ b/framework/source/uiconfiguration/uicategorydescription.cxx @@ -381,22 +381,6 @@ UICategoryDescription::UICategoryDescription( const Reference< XComponentContext impl_fillElements("ooSetupFactoryCmdCategoryConfigRef"); } -struct Instance { - explicit Instance( - css::uno::Reference<css::uno::XComponentContext> const & context): - instance(static_cast<cppu::OWeakObject *>( - new UICategoryDescription(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 * @@ -404,8 +388,7 @@ com_sun_star_comp_framework_UICategoryDescription_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 UICategoryDescription(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 80af7267b774..12ce9ec7d966 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -155,7 +155,8 @@ <service name="com.sun.star.ui.ToolBarFactory"/> </implementation> <implementation name="com.sun.star.comp.framework.UICategoryDescription" - constructor="com_sun_star_comp_framework_UICategoryDescription_get_implementation"> + constructor="com_sun_star_comp_framework_UICategoryDescription_get_implementation" + single-instance="true"> <service name="com.sun.star.ui.UICategoryDescription"/> <singleton name="com.sun.star.ui.theUICategoryDescription"/> </implementation> |