From 9a1f9c13439491d3b78a73f6eee5cda4e561401f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 22 Mar 2021 13:47:27 +0200 Subject: use single-use attribute for Introspection instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I8b9ed057ca77b9c783ad353b88205b296dbe54ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112930 Tested-by: Jenkins Reviewed-by: Noel Grandin --- stoc/source/inspect/introspection.component | 3 ++- stoc/source/inspect/introspection.cxx | 16 +--------------- 2 files changed, 3 insertions(+), 16 deletions(-) (limited to 'stoc') diff --git a/stoc/source/inspect/introspection.component b/stoc/source/inspect/introspection.component index 4cf06357ae24..84e121fad1f7 100644 --- a/stoc/source/inspect/introspection.component +++ b/stoc/source/inspect/introspection.component @@ -20,7 +20,8 @@ + constructor="com_sun_star_comp_stoc_Introspection_get_implementation" + single-instance="true"> diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 9317a5c35493..c7c0fd638175 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -2404,20 +2404,6 @@ css::uno::Reference Implementation::inspect( return new ImplIntrospectionAccess(aToInspectObj, pAccess); } -struct Instance { - explicit Instance( - css::uno::Reference const & context): - instance(new Implementation(context)) - {} - - rtl::Reference instance; -}; - -struct Singleton: - public rtl::StaticWithArg< - Instance, css::uno::Reference, Singleton> -{}; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * @@ -2427,7 +2413,7 @@ com_sun_star_comp_stoc_Introspection_get_implementation( { SAL_WARN_IF( arguments.hasElements(), "stoc", "unexpected singleton arguments"); - return cppu::acquire(Singleton::get(context).instance.get()); + return cppu::acquire(new Implementation(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit