From 958b128fe0f3391df137cbe4e9526432b8ca4695 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 18 Nov 2015 21:50:47 +0100 Subject: [PATCH] httpc: add proper http_poll destroy sequence --- src/httpc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/httpc.c b/src/httpc.c index e9f959f7a..5be4484b6 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -1585,11 +1585,19 @@ http_client_init ( const char *user_agent ) void http_client_done ( void ) { + http_client_t *hc; + http_running = 0; tvh_write(http_pipe.wr, "", 1); pthread_join(http_client_tid, NULL); tvh_pipe_close(&http_pipe); + pthread_mutex_lock(&http_lock); + TAILQ_FOREACH(hc, &http_clients, hc_link) + if (hc->hc_efd == http_poll) + hc->hc_efd = NULL; tvhpoll_destroy(http_poll); + http_poll = NULL; + pthread_mutex_unlock(&http_lock); free(http_user_agent); } -- 2.47.3