[Libreoffice-commits] core.git: framework/source framework/util

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Mar 21 17:01:29 UTC 2021


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

New commits:
commit a95abea894d098de8338b4138c76c28efe42d056
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Mar 21 13:20:12 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Mar 21 18:00:49 2021 +0100

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

diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx
index b66a9dc3ac2d..856d440230b6 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ b/framework/source/services/taskcreatorsrv.cxx
@@ -349,22 +349,6 @@ OUString TaskCreatorService::impl_filterNames( const OUString& sName )
     return sFiltered;
 }
 
-struct Instance {
-    explicit Instance(
-        css::uno::Reference<css::uno::XComponentContext> const & context):
-        instance(
-            static_cast<cppu::OWeakObject *>(new TaskCreatorService(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 *
@@ -372,8 +356,7 @@ com_sun_star_comp_framework_TaskCreator_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 TaskCreatorService(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index d6434cec85dd..cc5fcfb13faa 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -144,7 +144,8 @@
     <service name="com.sun.star.task.StatusIndicatorFactory"/>
   </implementation>
   <implementation name="com.sun.star.comp.framework.TaskCreator"
-      constructor="com_sun_star_comp_framework_TaskCreator_get_implementation">
+      constructor="com_sun_star_comp_framework_TaskCreator_get_implementation"
+      single-instance="true">
     <service name="com.sun.star.frame.TaskCreator"/>
   </implementation>
   <implementation name="com.sun.star.comp.framework.ToolBarControllerFactory"


More information about the Libreoffice-commits mailing list