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>
This commit is contained in:
Stephan Bergmann 2020-10-02 14:22:04 +02:00
parent df1fb2f78b
commit 00d62d03df
2 changed files with 3 additions and 4 deletions

View File

@ -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: */

View File

@ -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>