diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-10-02 14:29:23 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-10-02 20:50:31 +0200 |
commit | c1152bceb7593e47fcf6dc51d9538adfb5bd3c6e (patch) | |
tree | 46d5ea40d8116860f3c5465fb253545a3557118f /avmedia | |
parent | d777da05516d25fa1f027ea81436be65b5816d70 (diff) |
Use the new single-instance="true" attribute in avmedia
Change-Id: If3f882b4f28224d951492c26800d3009b8cb04b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103858
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/vlc/avmediavlc.component | 2 | ||||
-rw-r--r-- | avmedia/source/vlc/vlcmanager.cxx | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/avmedia/source/vlc/avmediavlc.component b/avmedia/source/vlc/avmediavlc.component index 595c3e8ef325..27009957141b 100644 --- a/avmedia/source/vlc/avmediavlc.component +++ b/avmedia/source/vlc/avmediavlc.component @@ -10,7 +10,7 @@ <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.media.Manager_VLC" - constructor="com_sun_star_comp_media_Manager_VLC_get_implementation"> + constructor="com_sun_star_comp_media_Manager_VLC_get_implementation" single-instance="true"> <service name="com.sun.star.comp.avmedia.Manager_VLC"/> </implementation> </component> diff --git a/avmedia/source/vlc/vlcmanager.cxx b/avmedia/source/vlc/vlcmanager.cxx index bb916013ef4f..a78dd4381f20 100644 --- a/avmedia/source/vlc/vlcmanager.cxx +++ b/avmedia/source/vlc/vlcmanager.cxx @@ -11,6 +11,7 @@ #include <boost/lexical_cast.hpp> #include <com/sun/star/uno/Exception.hpp> #include <cppuhelper/supportsservice.hxx> +#include <cppuhelper/weak.hxx> #include <sal/log.hxx> #include "vlcmanager.hxx" #include "vlcplayer.hxx" @@ -127,9 +128,7 @@ com_sun_star_comp_media_Manager_VLC_get_implementation( // Experimental for now - code is neither elegant nor well tested. if (!officecfg::Office::Common::Misc::ExperimentalMode::get(context)) return nullptr; - static uno::Reference< uno::XInterface > manager( *new ::avmedia::vlc::Manager ); - manager->acquire(); - return manager.get(); + return cppu::acquire(static_cast<cppu::OWeakObject *>(new ::avmedia::vlc::Manager)); } |