From: Jaroslav Kysela Date: Wed, 18 Nov 2015 20:50:47 +0000 (+0100) Subject: httpc: add proper http_poll destroy sequence X-Git-Tag: v4.2.1~1518 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=958b128fe0f3391df137cbe4e9526432b8ca4695;p=thirdparty%2Ftvheadend.git httpc: add proper http_poll destroy sequence --- 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); }