]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Ensure channelUpdate message is generated before previously referenced events are...
authorAdam Sutton <dev@adamsutton.me.uk>
Tue, 25 Sep 2012 12:33:00 +0000 (13:33 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Tue, 25 Sep 2012 12:33:00 +0000 (13:33 +0100)
src/epg.c

index 2f2ed758df11cf766bd3f5e4ffcce76d56954726..bec77bc290ac9ad9ded0575c4f25c4e4bd6eb687 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -1364,8 +1364,10 @@ static void _epg_channel_timer_callback ( void *p )
   channel_t *ch = (channel_t*)p;
 
   /* Clear now/next */
-  cur = ch->ch_epg_now;
-  nxt = ch->ch_epg_next;
+  if ((cur = ch->ch_epg_now))
+    cur->getref(cur);
+  if ((nxt = ch->ch_epg_next))
+    nxt->getref(nxt);
   ch->ch_epg_now = ch->ch_epg_next = NULL;
 
   /* Check events */
@@ -1412,6 +1414,10 @@ static void _epg_channel_timer_callback ( void *p )
            ch->ch_name);
     htsp_channel_update_current(ch);
   }
+
+  /* Remove refs */
+  if (cur) cur->putref(cur);
+  if (nxt) nxt->putref(nxt);
 }
 
 static epg_broadcast_t *_epg_channel_add_broadcast