diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-18 11:17:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-19 17:36:29 +0100 |
commit | 22e4f7a348f82fae7eefae5b67de3d829dceadcb (patch) | |
tree | 9ed2cf706bb6ed41dc2f0f8449b10278e32148d3 /framework | |
parent | 48f6ce530f3546570eabdf398388185ab988636b (diff) |
use single-use attribute for WindowContentFactoryManager
instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down
Change-Id: I877c541c11d5c667b0d94cb3875f4263a9323dcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112681
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uifactory/windowcontentfactorymanager.cxx | 19 | ||||
-rw-r--r-- | framework/util/fwk.component | 3 |
2 files changed, 3 insertions, 19 deletions
diff --git a/framework/source/uifactory/windowcontentfactorymanager.cxx b/framework/source/uifactory/windowcontentfactorymanager.cxx index 996fae5f41a1..0d2991c80b7e 100644 --- a/framework/source/uifactory/windowcontentfactorymanager.cxx +++ b/framework/source/uifactory/windowcontentfactorymanager.cxx @@ -193,22 +193,6 @@ uno::Reference< uno::XInterface > SAL_CALL WindowContentFactoryManager::createIn return xWindow; } -struct Instance { - explicit Instance( - css::uno::Reference<css::uno::XComponentContext> const & context): - instance(static_cast<cppu::OWeakObject *>( - new WindowContentFactoryManager(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 * @@ -216,8 +200,7 @@ com_sun_star_comp_framework_WindowContentFactoryManager_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 WindowContentFactoryManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index e056e8a9aeb6..d6ca2652d3cf 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -175,7 +175,8 @@ <service name="com.sun.star.util.URLTransformer"/> </implementation> <implementation name="com.sun.star.comp.framework.WindowContentFactoryManager" - constructor="com_sun_star_comp_framework_WindowContentFactoryManager_get_implementation"> + constructor="com_sun_star_comp_framework_WindowContentFactoryManager_get_implementation" + single-instance="true"> <service name="com.sun.star.ui.WindowContentFactoryManager"/> <singleton name="com.sun.star.ui.theWindowContentFactoryManager"/> </implementation> |