[vlc-commits] npapi: vlcplugin_base: Don't acquire/release NPObjects from vlc's threads

Hugo Beauzée-Luyssen git at videolan.org
Tue Jan 26 16:24:27 CET 2016


npapi-vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Jan 26 15:55:06 2016 +0100| [f06f820e5f2fafd17dcebcd5432ec26f6d7dd93f] | committer: Hugo Beauzée-Luyssen

npapi: vlcplugin_base: Don't acquire/release NPObjects from vlc's threads

Fix #16292

> https://code.videolan.org/videolan/npapi-vlc/commit/f06f820e5f2fafd17dcebcd5432ec26f6d7dd93f
---

 npapi/vlcplugin_base.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index 6e5bd9f..fb8aa73 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -279,22 +279,22 @@ bool VlcPluginBase::handle_event(void *)
 
 struct AsyncEventWrapper
 {
-    AsyncEventWrapper(NPP b, npapi::Variant&& l, npapi::VariantArray&& a)
+    AsyncEventWrapper(NPP b, NPObject* l, npapi::VariantArray&& a)
         : browser( b )
-        , listener( std::move( l ) )
+        , listener( l )
         , args( std::move( a ) )
     {
     }
 
     NPP browser;
-    npapi::Variant listener;
+    NPObject* listener;
     npapi::VariantArray args;
 };
 
 template <typename... Args>
-static void invokeEvent( NPP browser, npapi::Variant listener, Args&&... args )
+static void invokeEvent( NPP browser, NPObject* listener, Args&&... args )
 {
-    auto wrapper = new AsyncEventWrapper( browser, std::move( listener ), npapi::wrap( std::forward<Args>( args )... ) );
+    auto wrapper = new AsyncEventWrapper( browser, listener, npapi::wrap( std::forward<Args>( args )... ) );
     NPN_PluginThreadAsyncCall( browser, [](void* data) {
         auto w = reinterpret_cast<AsyncEventWrapper*>( data );
         NPVariant result;



More information about the vlc-commits mailing list