From d165672b325a2e2ea9f79126cd68f95251470576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Wed, 18 Aug 2010 12:22:49 +0000 Subject: [PATCH] When deleting IPTV source, also delete configuration on disk Ticket #253 --- src/iptv_input.c | 11 +++++++++++ src/transports.c | 3 +++ src/tvhead.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/src/iptv_input.c b/src/iptv_input.c index b8297913..03a2d101 100644 --- a/src/iptv_input.c +++ b/src/iptv_input.c @@ -371,6 +371,16 @@ iptv_grace_period(th_transport_t *t) } +/** + * + */ +static void +iptv_transport_dtor(th_transport_t *t) +{ + hts_settings_remove("iptvtransports/%s", t->tht_identifier); +} + + /** * */ @@ -411,6 +421,7 @@ iptv_transport_find(const char *id, int create) t->tht_setsourceinfo = iptv_transport_setsourceinfo; t->tht_quality_index = iptv_transport_quality; t->tht_grace_period = iptv_grace_period; + t->tht_dtor = iptv_transport_dtor; t->tht_iptv_fd = -1; LIST_INSERT_HEAD(&iptv_all_transports, t, tht_group_link); diff --git a/src/transports.c b/src/transports.c index 9c2cfa6e..92f9a6e6 100644 --- a/src/transports.c +++ b/src/transports.c @@ -435,6 +435,9 @@ transport_destroy(th_transport_t *t) th_subscription_t *s; channel_t *ch = t->tht_ch; + if(t->tht_dtor != NULL) + t->tht_dtor(t); + lock_assert(&global_lock); serviceprobe_delete(t); diff --git a/src/tvhead.h b/src/tvhead.h index d01e36bd..cea3f092 100644 --- a/src/tvhead.h +++ b/src/tvhead.h @@ -571,6 +571,8 @@ typedef struct th_transport { int (*tht_grace_period)(struct th_transport *t); + void (*tht_dtor)(struct th_transport *t); + /* * Per source type structs */