framework/source/uifactory/windowcontentfactorymanager.cxx | 19 ------------- framework/util/fwk.component | 3 +- 2 files changed, 3 insertions(+), 19 deletions(-)
New commits: commit 22e4f7a348f82fae7eefae5b67de3d829dceadcb Author: Noel <noel.gran...@collabora.co.uk> AuthorDate: Thu Mar 18 11:17:57 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Mar 19 17:36:29 2021 +0100 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.gran...@collabora.co.uk> 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> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits