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

Noel (via logerrit) logerrit at kemper.freedesktop.org
Sat Mar 20 15:50:58 UTC 2021


 framework/source/uifactory/uicontrollerfactory.cxx |   21 +--------------------
 framework/util/fwk.component                       |    3 ++-
 2 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit 918dc4c2050ff0e1e95d0dfc2c8db3a376161f16
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Thu Mar 18 11:20:50 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Mar 20 16:50:15 2021 +0100

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

diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx
index 493d1d5522d0..4b5d36948bc3 100644
--- a/framework/source/uifactory/uicontrollerfactory.cxx
+++ b/framework/source/uifactory/uicontrollerfactory.cxx
@@ -315,24 +315,6 @@ StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XCompon
 {
 }
 
-struct StatusbarControllerFactoryInstance {
-    explicit StatusbarControllerFactoryInstance(
-        css::uno::Reference<css::uno::XComponentContext> const & context):
-        instance(static_cast<cppu::OWeakObject *>(
-                    new StatusbarControllerFactory(context)))
-    {
-    }
-
-    css::uno::Reference<css::uno::XInterface> instance;
-};
-
-struct StatusbarControllerFactorySingleton:
-    public rtl::StaticWithArg<
-        StatusbarControllerFactoryInstance,
-        css::uno::Reference<css::uno::XComponentContext>,
-        StatusbarControllerFactorySingleton>
-{};
-
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
@@ -356,8 +338,7 @@ com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    return cppu::acquire(static_cast<cppu::OWeakObject *>(
-            StatusbarControllerFactorySingleton::get(context).instance.get()));
+    return cppu::acquire(new StatusbarControllerFactory(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 5c9085759b19..10a07911ab1b 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -128,7 +128,8 @@
     <service name="com.sun.star.frame.PopupMenuController"/>
   </implementation>
   <implementation name="com.sun.star.comp.framework.StatusBarControllerFactory"
-      constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation">
+      constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation"
+      single-instance="true">
     <service name="com.sun.star.frame.StatusbarControllerFactory"/>
     <singleton name="com.sun.star.frame.theStatusbarControllerFactory"/>
   </implementation>


More information about the Libreoffice-commits mailing list