From: Pierre d'Herbemont Date: Fri, 17 Aug 2007 09:11:18 +0000 (+0000) Subject: misc/events.c: We do want to send events to multiple listener. (oops, I should get... X-Git-Tag: 0.9.0-test0~6458 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7e4a86ee5a7332401c1b1d4cc05541c5c2ef3095;p=vlc misc/events.c: We do want to send events to multiple listener. (oops, I should get some sleep). In this situation we can simply unlock for the time being making sure we won't reuse resources that can disappear. --- diff --git a/src/misc/events.c b/src/misc/events.c index 0850ba3cbb..cb3e92145c 100644 --- a/src/misc/events.c +++ b/src/misc/events.c @@ -141,13 +141,17 @@ void vlc_event_send( vlc_event_manager_t * p_em, FOREACH_ARRAY( listener, listeners_group->listeners ) func = listener->pf_callback; user_data = listener->p_user_data; + /* This is safe to do that because we are sure + * that there will be no object owned references + * used after the lock. */ + vlc_mutex_unlock( &p_em->object_lock ); + func( p_event, user_data ); + vlc_mutex_lock( &p_em->object_lock ); FOREACH_END() break; } FOREACH_END() vlc_mutex_unlock( &p_em->object_lock ); - if( func ) - func( p_event, user_data ); } /**