From 198e86ca9f64d783de652565c8fa80a517e9bdf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Wed, 18 Aug 2010 12:18:10 +0000 Subject: [PATCH] If all services tied to a channel is deleted, delete the channel too. It seems reasonable after all. Ticket #253 --- src/transports.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/transports.c b/src/transports.c index 4775a55c..9c2cfa6e 100644 --- a/src/transports.c +++ b/src/transports.c @@ -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); + } }