Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
httpc: add proper http_poll destroy sequence
  • Loading branch information
perexg committed Nov 18, 2015
1 parent ae441a3 commit 958b128
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/httpc.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit 958b128

Please sign in to comment.