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

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


 shell/source/win32/simplemail/smplmail.component |    2 +-
 shell/source/win32/simplemail/smplmailsuppl.cxx  |    6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit ed3eda5d752b988411616c8cd96953ae6a2fe20f
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Oct 2 14:19:32 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Oct 2 20:41:23 2020 +0200

    Use the new single-instance="true" attribute in shell
    
    Change-Id: Ia8e454a65965cf99bafa795fe0bea4836ada2ee0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103846
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/shell/source/win32/simplemail/smplmail.component b/shell/source/win32/simplemail/smplmail.component
index 6b95bd8cdc5c..32446884ddc3 100644
--- a/shell/source/win32/simplemail/smplmail.component
+++ b/shell/source/win32/simplemail/smplmail.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.sys.shell.SimpleSystemMail"
-    constructor="shell_CSmplMailSuppl_get_implementation">
+    constructor="shell_CSmplMailSuppl_get_implementation" single-instance="true">
     <service name="com.sun.star.system.SimpleSystemMail"/>
   </implementation>
 </component>
diff --git a/shell/source/win32/simplemail/smplmailsuppl.cxx b/shell/source/win32/simplemail/smplmailsuppl.cxx
index eba930b09107..8e6cdfcd2403 100644
--- a/shell/source/win32/simplemail/smplmailsuppl.cxx
+++ b/shell/source/win32/simplemail/smplmailsuppl.cxx
@@ -18,8 +18,8 @@
  */
 
 #include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/weak.hxx>
 #include <com/sun/star/uno/XComponentContext.hpp>
-#include <rtl/ref.hxx>
 #include "smplmailsuppl.hxx"
 #include "smplmailclient.hxx"
 
@@ -79,9 +79,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 shell_CSmplMailSuppl_get_implementation(
     css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
 {
-    static rtl::Reference<CSmplMailSuppl> g_Instance(new CSmplMailSuppl());
-    g_Instance->acquire();
-    return static_cast<cppu::OWeakObject*>(g_Instance.get());
+    return cppu::acquire(static_cast<cppu::OWeakObject*>(new CSmplMailSuppl()));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list