diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-18 11:20:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-20 16:50:15 +0100 |
commit | 918dc4c2050ff0e1e95d0dfc2c8db3a376161f16 (patch) | |
tree | 6ad3e6df4552a8ddc26427a213cf3f2b73fab889 /framework | |
parent | 9dfaf0fa1977f70341e4b9add2ecd2afb35bf1f2 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uifactory/uicontrollerfactory.cxx | 21 | ||||
-rw-r--r-- | framework/util/fwk.component | 3 |
2 files changed, 3 insertions, 21 deletions
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<css::uno::XComponentContext> const & context): - instance(static_cast<cppu::OWeakObject *>( - new StatusbarControllerFactory(context))) - { - } - - css::uno::Reference<css::uno::XInterface> instance; -}; - -struct StatusbarControllerFactorySingleton: - public rtl::StaticWithArg< - StatusbarControllerFactoryInstance, - css::uno::Reference<css::uno::XComponentContext>, - 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<css::uno::Any> const &) { - return cppu::acquire(static_cast<cppu::OWeakObject *>( - 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 @@ <service name="com.sun.star.frame.PopupMenuController"/> </implementation> <implementation name="com.sun.star.comp.framework.StatusBarControllerFactory" - constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation"> + constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation" + single-instance="true"> <service name="com.sun.star.frame.StatusbarControllerFactory"/> <singleton name="com.sun.star.frame.theStatusbarControllerFactory"/> </implementation> |