[vlc-devel] [PATCH] android thread: fix a semaphore leaking in the case of a detached thread

Rémi Denis-Courmont remi at remlab.net
Tue Jun 10 16:58:48 CEST 2014


Le 2014-06-10 22:44, Adrien Maglo a écrit :
> ---
>  src/android/thread.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/android/thread.c b/src/android/thread.c
> index dfbe920..71f80a3 100644
> --- a/src/android/thread.c
> +++ b/src/android/thread.c
> @@ -314,6 +314,7 @@ static void clean_detached_thread(void *data)
>
>      /* release thread handle */
>      vlc_mutex_destroy(&thread->lock);
> +    vlc_sem_destroy(&thread->finished);
>      free(thread);
>  }

That seems OK to me. Then again, I would instead not initialize the 
semaphore if the thread is detached.

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list