[vlc-devel] commit: interface: Make sure the MonitorLibVLCDeath thread exit. (Pierre d' Herbemont )

git version control git at videolan.org
Sat Jul 5 12:55:33 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sat Jul  5 12:56:23 2008 +0200| [4d654a48d8eb44db1101e96c1c29b4f3813521bc]

interface: Make sure the MonitorLibVLCDeath thread exit.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4d654a48d8eb44db1101e96c1c29b4f3813521bc
---

 src/interface/interface.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/interface/interface.c b/src/interface/interface.c
index 5de0c71..51a62a5 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -147,6 +147,13 @@ int intf_RunThread( intf_thread_t *p_intf )
             return VLC_EGENERIC;
         }
         RunInterface( p_intf );
+
+        /* Make sure our MonitorLibVLCDeath thread exit */
+        vlc_object_kill( p_intf );
+        /* It is monitoring libvlc, not the p_intf */
+        vlc_object_signal( p_intf->p_libvlc );
+        vlc_thread_join( p_intf );
+
         vlc_object_detach( p_intf );
         vlc_object_release( p_intf );
         return VLC_SUCCESS;
@@ -255,7 +262,14 @@ static void MonitorLibVLCDeath( intf_thread_t *p_intf )
     libvlc_int_t * p_libvlc = p_intf->p_libvlc;
     vlc_object_lock( p_libvlc );
     while(vlc_object_alive( p_libvlc ) )
+    {
+        if(p_intf->b_die)
+        {
+            vlc_object_unlock( p_libvlc );
+            return;
+        }
         vlc_object_wait( p_libvlc );
+    }
     vlc_object_unlock( p_libvlc );
 
     /* Someone killed libvlc */




More information about the vlc-devel mailing list