diff --git a/src/epg.c b/src/epg.c index bec77bc2..58009eb8 100644 --- a/src/epg.c +++ b/src/epg.c @@ -1354,6 +1354,8 @@ static void _epg_channel_rem_broadcast { if (new) dvr_event_replaced(ebc, new); RB_REMOVE(&ch->ch_epg_schedule, ebc, sched_link); + if (ch->ch_epg_now == ebc) ch->ch_epg_now = NULL; + if (ch->ch_epg_next == ebc) ch->ch_epg_next = NULL; _epg_object_putref(ebc); } @@ -1468,7 +1470,6 @@ static epg_broadcast_t *_epg_channel_add_broadcast /* Remove overlapping (before) */ while ( (ebc = RB_PREV(ret, sched_link)) != NULL ) { if ( ebc->stop <= ret->start ) break; - if ( ch->ch_epg_now == ebc ) ch->ch_epg_now = NULL; _epg_channel_rem_broadcast(ch, ebc, ret); }