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 */