]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
When deleting IPTV source, also delete configuration on disk
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 18 Aug 2010 12:22:49 +0000 (12:22 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 18 Aug 2010 12:22:49 +0000 (12:22 +0000)
Ticket #253

src/iptv_input.c
src/transports.c
src/tvhead.h

index b8297913e848bfdcdc812ac0a597de42a8007cf5..03a2d1018fb63f0b8cf3efe7349374e6483e9e30 100644 (file)
@@ -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);
index 9c2cfa6e3384816f26709e8338887938b72f5347..92f9a6e68ffbd2600cdc7c1b416494427bbbd6e0 100644 (file)
@@ -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);
index d01e36bd95bd535b21c2874a41f7489788a3bffb..cea3f092ee2a0e1fc70880794ee2b3fcf179a1b8 100644 (file)
@@ -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
    */