summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-04-06 09:01:26 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2021-04-06 09:01:26 +0200
commit7fb13b3cbf6b7a2290a85e4d93b208c5a164dd43 (patch)
tree96f7310e4313c866f11e7c194836e1e9612e554a /epg.c
parent23d986657a5a4e7d086932d528715aaf8875bad3 (diff)
downloadvdr-7fb13b3cbf6b7a2290a85e4d93b208c5a164dd43.tar.gz
vdr-7fb13b3cbf6b7a2290a85e4d93b208c5a164dd43.tar.bz2
Fixed handling the timer counter in cSchedule::DelEvent()
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/epg.c b/epg.c
index 2aac8008..1f970f56 100644
--- a/epg.c
+++ b/epg.c
@@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 5.2 2021/04/04 11:06:30 kls Exp $
+ * $Id: epg.c 5.3 2021/04/06 09:01:26 kls Exp $
*/
#include "epg.h"
@@ -951,6 +951,13 @@ void cSchedule::DelEvent(cEvent *Event)
if (Event->schedule == this) {
UnhashEvent(Event);
Event->schedule = NULL;
+ // Removing the event from its schedule prevents it from decrementing the
+ // schedule's timer counter, so we do it here:
+ cEvent::numTimersMutex.Lock();
+ numTimersMutex.Lock();
+ numTimers -= Event->numTimers;
+ numTimersMutex.Unlock();
+ cEvent::numTimersMutex.Unlock();
events.Del(Event);
}
}