From a3069143195fc51aecced37fef9725c0f8acb9dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 31 May 2008 18:26:07 +0300 Subject: [PATCH] interaction: fix signal leak There is no point in unlocking and locking again immediatly. Not only will this typically fail to yield the CPU to another would-be waiting thread, but vlc_object_wait() will unlock&lock anyway. --- src/interface/interaction.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/interface/interaction.c b/src/interface/interaction.c index 4068f919a5..8a302c8e36 100644 --- a/src/interface/interaction.c +++ b/src/interface/interaction.c @@ -535,17 +535,13 @@ static void InteractionLoop( vlc_object_t *p_this ) int i; interaction_t *p_interaction = (interaction_t*) p_this; - while( !p_this->b_die ) + vlc_object_lock( p_this ); + while( vlc_object_alive( p_this ) ) { - vlc_object_lock( p_this ); - if( vlc_object_wait( p_this ) ) - { - vlc_object_unlock( p_this ); - break; - } InteractionManage( p_interaction ); - vlc_object_unlock( p_this ); + vlc_object_wait( p_this ); } + vlc_object_unlock( p_this ); /* Remove all dialogs - Interfaces must be able to clean up their data */ for( i = p_interaction->i_dialogs -1 ; i >= 0; i-- ) -- 2.39.2