Commit f06f820e authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

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

Fix #16292
parent 93422f55
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment