Ensure channelUpdate message is generated before previously referenced events are deleted.

This commit is contained in:
Adam Sutton 2012-09-25 13:33:00 +01:00
parent f214bb27e9
commit 376e33d0ed

View file

@ -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