[Libreoffice-commits] core.git: framework/source framework/util
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Fri Mar 19 16:37:52 UTC 2021
framework/source/uifactory/uielementfactorymanager.cxx | 19 -----------------
framework/util/fwk.component | 3 +-
2 files changed, 3 insertions(+), 19 deletions(-)
New commits:
commit f5784794f4cecd4fd57a803191b544f80f7ba02e
Author: Noel <noel.grandin at collabora.co.uk>
AuthorDate: Thu Mar 18 11:19:21 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Mar 19 17:37:07 2021 +0100
use single-use attribute for UIElementFactoryManager
instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down
Change-Id: I52193861c4b2e07c3655773c8d185b2036336da2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112682
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx
index 02d5435bab80..b1567724ff06 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -542,22 +542,6 @@ void SAL_CALL UIElementFactoryManager::deregisterFactory( const OUString& aType,
// SAFE
}
-struct Instance {
- explicit Instance(
- css::uno::Reference<css::uno::XComponentContext> const & context):
- instance(static_cast<cppu::OWeakObject *>(
- new UIElementFactoryManager(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 *
@@ -565,8 +549,7 @@ com_sun_star_comp_framework_UIElementFactoryManager_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 UIElementFactoryManager(context));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index d6ca2652d3cf..9f050373c603 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -166,7 +166,8 @@
<service name="com.sun.star.ui.UIConfigurationManager"/>
</implementation>
<implementation name="com.sun.star.comp.framework.UIElementFactoryManager"
- constructor="com_sun_star_comp_framework_UIElementFactoryManager_get_implementation">
+ constructor="com_sun_star_comp_framework_UIElementFactoryManager_get_implementation"
+ single-instance="true">
<service name="com.sun.star.ui.UIElementFactoryManager"/>
<singleton name="com.sun.star.ui.theUIElementFactoryManager"/>
</implementation>
More information about the Libreoffice-commits
mailing list