]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
comet: fix refcounting, fixes #4775
authorJaroslav Kysela <perex@perex.cz>
Fri, 8 Dec 2017 11:08:10 +0000 (12:08 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 8 Dec 2017 11:08:10 +0000 (12:08 +0100)
src/webui/comet.c

index 0d3dec0cc297780c2cad3b78d917096ad03dc838..7ae2aced3554c2106f64646908b4683c3775e1b8 100644 (file)
@@ -454,8 +454,8 @@ comet_mailbox_ws(http_connection_t *hc, const char *remain, void *opaque)
   }
 
   pthread_mutex_lock(&comet_mutex);
-  if (atomic_get(&comet_running))
-    cmb->cmb_refcount--;
+  assert(cmb->cmb_refcount > 0);
+  cmb->cmb_refcount--;
   cmb->cmb_last_used = mclk();
   pthread_mutex_unlock(&comet_mutex);