[Libreoffice-commits] core.git: framework/source framework/util
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Sat Mar 20 08:31:09 UTC 2021
framework/source/uiconfiguration/uicategorydescription.cxx | 19 -------------
framework/util/fwk.component | 3 +-
2 files changed, 3 insertions(+), 19 deletions(-)
New commits:
commit 8a6887717f4f667ff3621e98379e62e0d57a4a3a
Author: Noel <noel.grandin at collabora.co.uk>
AuthorDate: Thu Mar 18 11:28:45 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Mar 20 09:30:20 2021 +0100
use single-use attribute for UICategoryDescription
instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down
Change-Id: Ie6c8f76b88f1e059b81b28a40343a2207531b0d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112688
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx b/framework/source/uiconfiguration/uicategorydescription.cxx
index 279b8b7fd192..218032c5238e 100644
--- a/framework/source/uiconfiguration/uicategorydescription.cxx
+++ b/framework/source/uiconfiguration/uicategorydescription.cxx
@@ -381,22 +381,6 @@ UICategoryDescription::UICategoryDescription( const Reference< XComponentContext
impl_fillElements("ooSetupFactoryCmdCategoryConfigRef");
}
-struct Instance {
- explicit Instance(
- css::uno::Reference<css::uno::XComponentContext> const & context):
- instance(static_cast<cppu::OWeakObject *>(
- new UICategoryDescription(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 *
@@ -404,8 +388,7 @@ com_sun_star_comp_framework_UICategoryDescription_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 UICategoryDescription(context));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 80af7267b774..12ce9ec7d966 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -155,7 +155,8 @@
<service name="com.sun.star.ui.ToolBarFactory"/>
</implementation>
<implementation name="com.sun.star.comp.framework.UICategoryDescription"
- constructor="com_sun_star_comp_framework_UICategoryDescription_get_implementation">
+ constructor="com_sun_star_comp_framework_UICategoryDescription_get_implementation"
+ single-instance="true">
<service name="com.sun.star.ui.UICategoryDescription"/>
<singleton name="com.sun.star.ui.theUICategoryDescription"/>
</implementation>
More information about the Libreoffice-commits
mailing list