[Libreoffice-commits] core.git: package/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 2 18:43:14 UTC 2020


 package/source/xstor/xfactory.cxx    |    5 ++---
 package/source/xstor/xstor.component |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 00d62d03dffd41a923c5920941770d37f52fb6e0
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Oct 2 14:22:04 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Oct 2 20:42:29 2020 +0200

    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 at redhat.com>

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>


More information about the Libreoffice-commits mailing list