]> git.sesse.net Git - vlc/commitdiff
Extensions: do not wait on widget if dialog is deleted
authorJean-Philippe André <jpeg@videolan.org>
Wed, 3 Feb 2010 23:49:21 +0000 (00:49 +0100)
committerJean-Philippe André <jpeg@videolan.org>
Thu, 4 Feb 2010 00:54:25 +0000 (01:54 +0100)
If the dialog is about to be deleted, it's too late to care about
the widget (it has already been removed from the UI).

modules/misc/lua/libs/dialog.c

index ffb2ec0c91f3ad6e9a90ba93d4abe8670918611c..2364dc69ab31e58f047f003a17b020d4f44ddd5c 100644 (file)
@@ -862,8 +862,12 @@ static int vlclua_dialog_delete_widget( lua_State *L )
 
     vlc_mutex_lock( &p_dlg->lock );
 
-    /* Same remarks as for dialog delete */
-    while( p_widget->p_sys_intf != NULL )
+    /* Same remarks as for dialog delete.
+     * If the dialog is deleted or about to be deleted, then there is no
+     * need to wait on this particular widget that already doesn't exist
+     * anymore in the UI */
+    while( p_widget->p_sys_intf != NULL && !p_dlg->b_kill
+           && p_dlg->p_sys_intf != NULL )
     {
         vlc_cond_wait( &p_dlg->cond, &p_dlg->lock );
     }