diff options
-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)); } |