Commit e1cebcfa authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

misc/events.c: (Thanks to ileoo) Fix a crash.

parent 9517775c
...@@ -161,6 +161,7 @@ void vlc_event_send( vlc_event_manager_t * p_em, ...@@ -161,6 +161,7 @@ void vlc_event_send( vlc_event_manager_t * p_em,
if( !array_of_cached_listeners ) if( !array_of_cached_listeners )
{ {
msg_Err( p_em->p_parent_object, "Not enough memory in vlc_event_send" ); msg_Err( p_em->p_parent_object, "Not enough memory in vlc_event_send" );
vlc_mutex_unlock( &p_em->object_lock );
return; return;
} }
...@@ -170,7 +171,9 @@ void vlc_event_send( vlc_event_manager_t * p_em, ...@@ -170,7 +171,9 @@ void vlc_event_send( vlc_event_manager_t * p_em,
#ifdef DEBUG_EVENT #ifdef DEBUG_EVENT
cached_listener->psz_debug_name = strdup(cached_listener->psz_debug_name); cached_listener->psz_debug_name = strdup(cached_listener->psz_debug_name);
#endif #endif
cached_listener += sizeof(vlc_event_listener_t); printf("%p\n", cached_listener);
cached_listener++;
printf("%p\n", cached_listener-1);
FOREACH_END() FOREACH_END()
break; break;
...@@ -192,7 +195,7 @@ void vlc_event_send( vlc_event_manager_t * p_em, ...@@ -192,7 +195,7 @@ void vlc_event_send( vlc_event_manager_t * p_em,
#endif #endif
cached_listener->pf_callback( p_event, cached_listener->p_user_data ); cached_listener->pf_callback( p_event, cached_listener->p_user_data );
cached_listener += sizeof(vlc_event_listener_t) ; cached_listener++;
} }
free( array_of_cached_listeners ); free( array_of_cached_listeners );
......
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