summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-03-22 13:47:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-23 07:39:57 +0100
commit9a1f9c13439491d3b78a73f6eee5cda4e561401f (patch)
tree8646195f29e515c1fa41ca02f2145b72b4fc9692 /stoc
parent951a9342631129832e647bd8a303a959308bad65 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/inspect/introspection.component3
-rw-r--r--stoc/source/inspect/introspection.cxx16
2 files changed, 3 insertions, 16 deletions
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 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.stoc.Introspection"
- constructor="com_sun_star_comp_stoc_Introspection_get_implementation">
+ constructor="com_sun_star_comp_stoc_Introspection_get_implementation"
+ single-instance="true">
<service name="com.sun.star.beans.Introspection"/>
<singleton name="com.sun.star.beans.theIntrospection"/>
</implementation>
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<css::beans::XIntrospectionAccess> Implementation::inspect(
return new ImplIntrospectionAccess(aToInspectObj, pAccess);
}
-struct Instance {
- explicit Instance(
- css::uno::Reference<css::uno::XComponentContext> const & context):
- instance(new Implementation(context))
- {}
-
- rtl::Reference<cppu::OWeakObject> instance;
-};
-
-struct Singleton:
- public rtl::StaticWithArg<
- Instance, css::uno::Reference<css::uno::XComponentContext>, 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: */