summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-03-18 11:16:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-19 13:58:40 +0100
commit896bed62eff679e354e46635f5659fe0caa650fe (patch)
treed3504239e7d38f6a5c897e2c4b4ecdb61203cdf1 /sfx2
parent42969ac2c3db42460a9aaa8b51df76f58b360526 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/shutdownicon.cxx21
-rw-r--r--sfx2/util/sfx.component3
2 files changed, 3 insertions, 21 deletions
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>