[vlc-commits] remoteosd: partially fix worker thread cleanup

Rémi Denis-Courmont git at videolan.org
Thu Jul 9 20:34:18 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul  9 21:12:42 2015 +0300| [d48d2349c0efb803d6bda4b383aa276b8ea757e0] | committer: Rémi Denis-Courmont

remoteosd: partially fix worker thread cleanup

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

 modules/video_filter/remoteosd.c |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/modules/video_filter/remoteosd.c b/modules/video_filter/remoteosd.c
index 850cdac..6ec1efd 100644
--- a/modules/video_filter/remoteosd.c
+++ b/modules/video_filter/remoteosd.c
@@ -312,6 +312,11 @@ static void DestroyFilter( vlc_object_t *p_this )
     vlc_cancel( p_sys->worker_thread );
     vlc_join( p_sys->worker_thread, NULL );
 
+    if( p_sys->p_pic != NULL )
+        picture_Release( p_sys->p_pic );
+    if( p_sys->i_socket >= 0 )
+        net_Close( p_sys->i_socket );
+
     vlc_mutex_destroy( &p_sys->lock );
     free( p_sys->psz_host );
     free( p_sys->psz_passwd );
@@ -668,16 +673,6 @@ static void* vnc_worker_thread( void *obj )
 
 exit:
 
-    vlc_mutex_lock( &p_sys->lock );
-    p_sys->i_socket = -1;
-
-    if( p_sys->p_pic )
-        picture_Release( p_sys->p_pic );
-
-    p_sys->b_need_update = true;
-    vlc_mutex_unlock( &p_sys->lock );
-    net_Close( fd );
-
     msg_Dbg( p_filter, "VNC message reader thread ended" );
     vlc_restorecancel (canc);
     return NULL;



More information about the vlc-commits mailing list