]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
epg: Correctly unlink from channels (avoid rearming timers causing segfault)
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 8 Jun 2011 21:04:33 +0000 (23:04 +0200)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 8 Jun 2011 21:07:54 +0000 (23:07 +0200)
Fixes #553
Fixes #533
Fixes #513

src/epg.c

index aac82ea90832e7426c6b7a43c2373ebc41e4616a..e1d5afdd3dfe3bf27d34544c27658db3fd356179 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -482,11 +482,12 @@ epg_unlink_from_channel(channel_t *ch)
 {
   event_t *e;
 
+  while((e = ch->ch_epg_events.root) != NULL)
+    epg_remove_event_from_channel(ch, e);
+
   gtimer_disarm(&ch->ch_epg_timer_head);
   gtimer_disarm(&ch->ch_epg_timer_current);
 
-  while((e = ch->ch_epg_events.root) != NULL)
-    epg_remove_event_from_channel(ch, e);
 }