- /* It will unlock socket reading */
- vlc_object_kill( p_filter );
-
- /* */
- if( p_sys->p_worker_thread )
- {
- msg_Dbg( p_filter, "joining worker_thread" );
- vlc_object_kill( p_sys->p_worker_thread );
- vlc_thread_join( p_sys->p_worker_thread );
- vlc_object_detach( p_sys->p_worker_thread );
- vlc_object_release( p_sys->p_worker_thread );
- msg_Dbg( p_filter, "released worker_thread" );
- }
+ msg_Dbg( p_filter, "joining worker_thread" );
+ vlc_cancel( p_sys->worker_thread );
+ vlc_join( p_sys->worker_thread, NULL );
+ msg_Dbg( p_filter, "released worker_thread" );