diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-29 11:22:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-29 14:35:44 +0200 |
commit | 6c7d6924511f3006f64fb9d3eadd289778098571 (patch) | |
tree | 297a3f410e9b3281a1799b18c98441a837b8a560 /xmlsecurity | |
parent | 2e894d5053dccadc41f4c449e8fbdd3ada0c5bdc (diff) |
rtl::Static -> static local
in a handful cases, like a map or a vector, we don't need init on demand
at all, the default constructor can be laid out at compile time
Change-Id: I2d404584b5aa23db7b1f779e160e04e72dd2aa74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119656
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/component/certificatecontainer.cxx | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx index e311b1b600f8..e230c7b2ce83 100644 --- a/xmlsecurity/source/component/certificatecontainer.cxx +++ b/xmlsecurity/source/component/certificatecontainer.cxx @@ -141,30 +141,12 @@ CertificateContainer::getSupportedServiceNames( ) return { "com.sun.star.security.CertificateContainer" }; } -namespace -{ -struct Instance -{ - explicit Instance(css::uno::Reference<css::uno::XComponentContext> const& context) - : instance(new CertificateContainer(context)) - { - } - - rtl::Reference<CertificateContainer> instance; -}; - -struct Singleton - : public rtl::StaticWithArg<Instance, css::uno::Reference<css::uno::XComponentContext>, - Singleton> -{ -}; -} - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* com_sun_star_security_CertificateContainer_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(Singleton::get(context).instance.get()); + static rtl::Reference<CertificateContainer> gContainer = new CertificateContainer(context); + return cppu::acquire(gContainer.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |