avmedia/source/vlc/avmediavlc.component |    2 +-
 avmedia/source/vlc/vlcmanager.cxx       |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit c1152bceb7593e47fcf6dc51d9538adfb5bd3c6e
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Fri Oct 2 14:29:23 2020 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Fri Oct 2 20:50:31 2020 +0200

    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 <sberg...@redhat.com>

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));
 }
 
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to