summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-10-02 14:17:58 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-10-02 20:39:52 +0200
commit8c1f608c1400d314061f96d6d63b3357da5b2786 (patch)
treec2f3f4fffa6830ec356ade66fb3f2daaece1fdb9 /svl
parent9947cae47cbfb53f560d537ca0be3df2e694fbba (diff)
Use the new single-instance="true" attribute in svl
Change-Id: Iedd4348f3ea896dc613e0062a1a9cb5904c8bbb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103844 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/fsstor/fsfactory.cxx6
-rw-r--r--svl/source/fsstor/fsstorage.component2
2 files changed, 3 insertions, 5 deletions
diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx
index 2b596f1a7cc4..98ec1feb8c65 100644
--- a/svl/source/fsstor/fsfactory.cxx
+++ b/svl/source/fsstor/fsfactory.cxx
@@ -24,7 +24,7 @@
#include <com/sun/star/io/IOException.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
-
+#include <cppuhelper/weak.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/tempfile.hxx>
@@ -155,9 +155,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
svl_FSStorageFactory_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- static rtl::Reference<FSStorageFactory> g_Instance(new FSStorageFactory(context));
- g_Instance->acquire();
- return static_cast<cppu::OWeakObject*>(g_Instance.get());
+ return cppu::acquire(static_cast<cppu::OWeakObject*>(new FSStorageFactory(context)));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component
index 915850bab86d..7d20474b36ac 100644
--- a/svl/source/fsstor/fsstorage.component
+++ b/svl/source/fsstor/fsstorage.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.FileSystemStorageFactory"
- constructor="svl_FSStorageFactory_get_implementation">
+ constructor="svl_FSStorageFactory_get_implementation" single-instance="true">
<service name="com.sun.star.comp.embed.FileSystemStorageFactory"/>
<service name="com.sun.star.embed.FileSystemStorageFactory"/>
</implementation>