diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-03-21 13:22:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-21 15:44:34 +0100 |
commit | b4ec5a94bd84017eb7db0b7f23d60265bbb9b040 (patch) | |
tree | 38833f2f330e054d617406ef496569a48473b29b /framework/source/services | |
parent | 4efc4a43ff481661990b304f9599f811db39f7dc (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/source/services')
-rw-r--r-- | framework/source/services/substitutepathvars.cxx | 19 |
1 files changed, 1 insertions, 18 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: */ |