sfx2/source/appl/shutdownicon.cxx | 21 +-------------------- sfx2/util/sfx.component | 3 ++- 2 files changed, 3 insertions(+), 21 deletions(-)
New commits: commit 896bed62eff679e354e46635f5659fe0caa650fe Author: Noel <noel.gran...@collabora.co.uk> AuthorDate: Thu Mar 18 11:16:27 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Mar 19 13:58:40 2021 +0100 use single-use attribute for ShutdownIcon instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I40de6f9d9c86f1056860d6a9e412b0c1571703bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 40febc9b422a..fcebfe809d1e 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -706,31 +706,12 @@ css::uno::Any SAL_CALL ShutdownIcon::getFastPropertyValue( ::sal_Int32 nHandle ) return aValue; } -namespace { - -struct Instance { - explicit Instance( - css::uno::Reference<css::uno::XComponentContext> const & context): - instance(static_cast<cppu::OWeakObject *>(new ShutdownIcon(context))) - {} - - rtl::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 * com_sun_star_comp_desktop_QuickstartWrapper_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 ShutdownIcon(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component index a8f4b7104991..a7c9930e0ec8 100644 --- a/sfx2/util/sfx.component +++ b/sfx2/util/sfx.component @@ -33,7 +33,8 @@ <service name="com.sun.star.writer.DocumentProperties"/> </implementation> <implementation name="com.sun.star.comp.desktop.QuickstartWrapper" - constructor="com_sun_star_comp_desktop_QuickstartWrapper_get_implementation"> + constructor="com_sun_star_comp_desktop_QuickstartWrapper_get_implementation" + single-instance="true"> <service name="com.sun.star.office.Quickstart"/> <singleton name="com.sun.star.office.theQuickstart"/> </implementation> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits