Commit 7c019259 authored by Sergey Radionov's avatar Sergey Radionov Committed by Jean-Baptiste Kempf

npapi: fixed event delivery reentrancy problem

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 46634a5c
......@@ -203,7 +203,11 @@ EventObj::~EventObj()
void EventObj::deliver(NPP browser)
{
if(_already_in_deliver)
return;
plugin_lock(&lock);
_already_in_deliver = true;
for( ev_l::iterator iter = _elist.begin(); iter != _elist.end(); ++iter )
{
......@@ -237,6 +241,7 @@ void EventObj::deliver(NPP browser)
}
_elist.clear();
_already_in_deliver = false;
plugin_unlock(&lock);
}
......
......@@ -153,7 +153,7 @@ private:
};
libvlc_event_manager_t *_em; /* libvlc media_player event manager */
public:
EventObj(): _em(NULL) { /* deferred to init() */ }
EventObj(): _em(NULL), _already_in_deliver(false) { /* deferred to init() */ }
bool init();
~EventObj();
......@@ -172,6 +172,7 @@ private:
ev_l _elist; /* scheduled events list for delivery to browser */
plugin_lock_t lock;
bool _already_in_deliver;
};
typedef enum vlc_toolbar_clicked_e {
......
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