make vlc_object_timedwait() return immediately if the object or libvlc is dying
authorRafaël Carré <funman@videolan.org>
Wed, 14 Nov 2007 00:30:45 +0000 (00:30 +0000)
committerRafaël Carré <funman@videolan.org>
Wed, 14 Nov 2007 00:30:45 +0000 (00:30 +0000)
src/misc/objects.c

index 79a64d2..31e5133 100644 (file)
@@ -545,6 +545,8 @@ int __vlc_object_timedwait( vlc_object_t *obj, mtime_t deadline )
     int v;
 
     vlc_assert_locked( &obj->object_lock );
+    if( obj->b_die || obj->p_libvlc->b_die )
+        return -1; /* don't wait if we are dying */
     v = vlc_cond_timedwait( &obj->object_wait, &obj->object_lock, deadline );
     if( v == 0 ) /* signaled */
         return obj->b_die ? -1 : 1;