]> git.sesse.net Git - vlc/commitdiff
interaction: fix signal leak
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 31 May 2008 15:26:07 +0000 (18:26 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 31 May 2008 16:01:04 +0000 (19:01 +0300)
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

index 4068f919a5a82adb95ca7d5fff732abe476b396b..8a302c8e366781714fa74fe3db808bf9f0b420b7 100644 (file)
@@ -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-- )