]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
httpc: add proper http_poll destroy sequence
authorJaroslav Kysela <perex@perex.cz>
Wed, 18 Nov 2015 20:50:47 +0000 (21:50 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 18 Nov 2015 20:50:47 +0000 (21:50 +0100)
src/httpc.c

index e9f959f7a11339c8f2628f3dbabb2bcb099afa9b..5be4484b6461ad4b5998cd607ada3709e4b94c18 100644 (file)
@@ -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);
 }