svl/source/fsstor/fsfactory.cxx       |    6 ++----
 svl/source/fsstor/fsstorage.component |    2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 8c1f608c1400d314061f96d6d63b3357da5b2786
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Fri Oct 2 14:17:58 2020 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Fri Oct 2 20:39:52 2020 +0200

    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 <sberg...@redhat.com>

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>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to