summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-03-21 13:22:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-21 15:44:34 +0100
commitb4ec5a94bd84017eb7db0b7f23d60265bbb9b040 (patch)
tree38833f2f330e054d617406ef496569a48473b29b /framework
parent4efc4a43ff481661990b304f9599f811db39f7dc (diff)
use single-use attribute for SubstitutePathVariables
instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I1b488ce343063b9f07d76d9dec2e12bd153c942a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112833 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/services/substitutepathvars.cxx19
-rw-r--r--framework/util/fwk.component3
2 files changed, 3 insertions, 19 deletions
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index f5f7b71ffe61..2a3cb4994fc6 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -687,22 +687,6 @@ void SubstitutePathVariables::SetPredefinedPathVariables()
m_aPreDefVars.m_FixedVar[ PREDEFVAR_TEMP ] = aTmp;
}
-struct Instance {
- explicit Instance(
- css::uno::Reference<css::uno::XComponentContext> const & context):
- instance(
- static_cast<cppu::OWeakObject *>(new SubstitutePathVariables(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 *
@@ -710,8 +694,7 @@ com_sun_star_comp_framework_PathSubstitution_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 SubstitutePathVariables(context));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 10a07911ab1b..4cbf51e97228 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -106,7 +106,8 @@
<singleton name="com.sun.star.util.thePathSettings"/>
</implementation>
<implementation name="com.sun.star.comp.framework.PathSubstitution"
- constructor="com_sun_star_comp_framework_PathSubstitution_get_implementation">
+ constructor="com_sun_star_comp_framework_PathSubstitution_get_implementation"
+ single-instance="true">
<service name="com.sun.star.util.PathSubstitution"/>
</implementation>
<implementation name="com.sun.star.comp.framework.PopupMenuControllerFactory"