]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
If all services tied to a channel is deleted, delete the channel too.
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 18 Aug 2010 12:18:10 +0000 (12:18 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 18 Aug 2010 12:18:10 +0000 (12:18 +0000)
It seems reasonable after all.

Ticket #253

src/transports.c

index 4775a55caf3346e2a1abae096ad3ea7282112357..9c2cfa6e3384816f26709e8338887938b72f5347 100644 (file)
@@ -433,7 +433,8 @@ transport_destroy(th_transport_t *t)
 {
   th_stream_t *st;
   th_subscription_t *s;
-  
+  channel_t *ch = t->tht_ch;
+
   lock_assert(&global_lock);
 
   serviceprobe_delete(t);
@@ -469,6 +470,11 @@ transport_destroy(th_transport_t *t)
   free(t->tht_pmt_section);
 
   transport_unref(t);
+
+  if(ch != NULL) {
+    if(LIST_FIRST(&ch->ch_transports) == NULL) 
+      channel_delete(ch);
+  }
 }