From 918dc4c2050ff0e1e95d0dfc2c8db3a376161f16 Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 18 Mar 2021 11:20:50 +0200 Subject: use single-use attribute for StatusBarControllerFactory instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: Ifec5f54633508aa66492599caf80ed2bf3d7cbe5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112683 Tested-by: Jenkins Reviewed-by: Noel Grandin --- framework/source/uifactory/uicontrollerfactory.cxx | 21 +-------------------- framework/util/fwk.component | 3 ++- 2 files changed, 3 insertions(+), 21 deletions(-) (limited to 'framework') diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx index 493d1d5522d0..4b5d36948bc3 100644 --- a/framework/source/uifactory/uicontrollerfactory.cxx +++ b/framework/source/uifactory/uicontrollerfactory.cxx @@ -315,24 +315,6 @@ StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XCompon { } -struct StatusbarControllerFactoryInstance { - explicit StatusbarControllerFactoryInstance( - css::uno::Reference const & context): - instance(static_cast( - new StatusbarControllerFactory(context))) - { - } - - css::uno::Reference instance; -}; - -struct StatusbarControllerFactorySingleton: - public rtl::StaticWithArg< - StatusbarControllerFactoryInstance, - css::uno::Reference, - StatusbarControllerFactorySingleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -356,8 +338,7 @@ com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence const &) { - return cppu::acquire(static_cast( - StatusbarControllerFactorySingleton::get(context).instance.get())); + return cppu::acquire(new StatusbarControllerFactory(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index 5c9085759b19..10a07911ab1b 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -128,7 +128,8 @@ + constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation" + single-instance="true"> -- cgit v1.2.3