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

Noel (via logerrit) logerrit at kemper.freedesktop.org
Fri Mar 19 19:05:26 UTC 2021


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

New commits:
commit 109312f4223a986444c589eca51eac7cdeb5ff48
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Thu Mar 18 11:24:37 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Mar 19 20:04:43 2021 +0100

    use single-use attribute for PopupMenuControllerFactory
    
    instead of rtl::Instance, which means it will get
    cleaned up when UNO shuts down
    
    Change-Id: Ib7e51a5ba945ad151176d207d2d40f13d0fa6813
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112685
    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 619b66d7c420..5f81f80be026 100644
--- a/framework/source/uifactory/uicontrollerfactory.cxx
+++ b/framework/source/uifactory/uicontrollerfactory.cxx
@@ -261,24 +261,6 @@ PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XCompon
 {
 }
 
-struct PopupMenuControllerFactoryInstance {
-    explicit PopupMenuControllerFactoryInstance(
-        css::uno::Reference<css::uno::XComponentContext> const & context):
-        instance(static_cast<cppu::OWeakObject *>(
-                    new PopupMenuControllerFactory(context)))
-    {
-    }
-
-    css::uno::Reference<css::uno::XInterface> instance;
-};
-
-struct PopupMenuControllerFactorySingleton:
-    public rtl::StaticWithArg<
-        PopupMenuControllerFactoryInstance,
-        css::uno::Reference<css::uno::XComponentContext>,
-        PopupMenuControllerFactorySingleton>
-{};
-
 class ToolbarControllerFactory :  public UIControllerFactory
 {
 public:
@@ -376,8 +358,7 @@ com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    return cppu::acquire(static_cast<cppu::OWeakObject *>(
-            PopupMenuControllerFactorySingleton::get(context).instance.get()));
+    return cppu::acquire(new PopupMenuControllerFactory(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index f3a0cfcf1edd..2d71213468d6 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -110,7 +110,8 @@
     <service name="com.sun.star.util.PathSubstitution"/>
   </implementation>
   <implementation name="com.sun.star.comp.framework.PopupMenuControllerFactory"
-      constructor="com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation">
+      constructor="com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation"
+      single-instance="true">
     <service name="com.sun.star.frame.PopupMenuControllerFactory"/>
     <singleton name="com.sun.star.frame.thePopupMenuControllerFactory"/>
   </implementation>


More information about the Libreoffice-commits mailing list