diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-10-02 14:22:04 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-10-02 20:42:29 +0200 |
commit | 00d62d03dffd41a923c5920941770d37f52fb6e0 (patch) | |
tree | b6dff0db1763da48b2e0e027b0b3fd644ceac38c /package | |
parent | df1fb2f78b4e979d90a3b9b7459c16eb13024a1a (diff) |
Use the new single-instance="true" attribute in package
Change-Id: I3effdd2500de6accaa075cfc80bdd2654dc13801
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103849
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/xfactory.cxx | 5 | ||||
-rw-r--r-- | package/source/xstor/xstor.component | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index f398e5f2b909..89e94dc4e3d3 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.cxx @@ -32,6 +32,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> #include <cppuhelper/supportsservice.hxx> +#include <cppuhelper/weak.hxx> #include <osl/diagnose.h> #include "xfactory.hxx" @@ -287,9 +288,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* package_OStorageFactory_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - static rtl::Reference<OStorageFactory> g_Instance(new OStorageFactory(context)); - g_Instance->acquire(); - return static_cast<cppu::OWeakObject*>(g_Instance.get()); + return cppu::acquire(static_cast<cppu::OWeakObject*>(new OStorageFactory(context))); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/xstor/xstor.component b/package/source/xstor/xstor.component index 550501f269f6..ff6de82b654f 100644 --- a/package/source/xstor/xstor.component +++ b/package/source/xstor/xstor.component @@ -20,7 +20,7 @@ <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.embed.StorageFactory" - constructor="package_OStorageFactory_get_implementation"> + constructor="package_OStorageFactory_get_implementation" single-instance="true"> <service name="com.sun.star.comp.embed.StorageFactory"/> <service name="com.sun.star.embed.StorageFactory"/> </implementation> |