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

New commits:
commit f86e20fa4aa425fbc4e97cccdfa3080422a6584b
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Mar 21 13:27:05 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Mar 21 17:30:16 2021 +0100

    use single-use attribute for ModuleManager
    
    instead of rtl::Instance, which means it will get
    cleaned up when UNO shuts down
    
    Change-Id: I80ee080d4b62065dadc9c406485a81433a38ffaa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112841
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/framework/source/services/modulemanager.cxx 
b/framework/source/services/modulemanager.cxx
index ad98644bb0b7..c03bf2611ecd 100644
--- a/framework/source/services/modulemanager.cxx
+++ b/framework/source/services/modulemanager.cxx
@@ -336,21 +336,6 @@ OUString ModuleManager::implts_identify(const 
css::uno::Reference< css::uno::XIn
     return OUString();
 }
 
-struct Instance {
-    explicit Instance(
-        css::uno::Reference<css::uno::XComponentContext> const & context):
-        instance(static_cast<cppu::OWeakObject *>(new ModuleManager(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 *
@@ -358,8 +343,7 @@ 
com_sun_star_comp_framework_ModuleManager_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 ModuleManager(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 4cbf51e97228..d6434cec85dd 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -83,7 +83,8 @@
     <service name="com.sun.star.ui.ModuleAcceleratorConfiguration"/>
   </implementation>
   <implementation name="com.sun.star.comp.framework.ModuleManager"
-      
constructor="com_sun_star_comp_framework_ModuleManager_get_implementation">
+      
constructor="com_sun_star_comp_framework_ModuleManager_get_implementation"
+      single-instance="true">
     <service name="com.sun.star.frame.ModuleManager"/>
   </implementation>
   <implementation 
name="com.sun.star.comp.framework.ModuleUIConfigurationManager"
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to