framework/source/services/substitutepathvars.cxx |   19 +------------------
 framework/util/fwk.component                     |    3 ++-
 2 files changed, 3 insertions(+), 19 deletions(-)

New commits:
commit b4ec5a94bd84017eb7db0b7f23d60265bbb9b040
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Mar 21 13:22:22 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Mar 21 15:44:34 2021 +0100

    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.gran...@collabora.co.uk>

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"
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to