diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-03-30 16:49:50 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-04-01 17:00:44 +0200 |
commit | dfb2c2b031bbae0cf1fc10631ce07dc0b0de4209 (patch) | |
tree | 9942704d9db710c54273c8627a2c607eb369f049 | |
parent | 060089548a2cb6d3e19e9a162b1fe09776de3883 (diff) | |
download | vdr-plugin-tvguide-dfb2c2b031bbae0cf1fc10631ce07dc0b0de4209.tar.gz vdr-plugin-tvguide-dfb2c2b031bbae0cf1fc10631ce07dc0b0de4209.tar.bz2 |
Eliminate a seqfault in cRecManager::DeleteSearchTimer
-rw-r--r-- | recmanager.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/recmanager.c b/recmanager.c index c09d25a..f152bf5 100644 --- a/recmanager.c +++ b/recmanager.c @@ -543,45 +543,33 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi return; int searchTimerID = searchTimer->GetID(); if (delTimers) { + cTimers* timers; #if VDRVERSNUM >= 20301 + { LOCK_TIMERS_WRITE; - cTimer *timer = Timers->First(); + timers = Timers; + } #else - cTimer *timer = Timers.First(); + timers = &Timers; #endif + cTimer *timer = timers->First(); while(timer) { if (!timer->Recording()) { char* searchID = GetAuxValue(timer, "s-id"); if (searchID) { if (searchTimerID == atoi(searchID)) { -#if VDRVERSNUM >= 20301 - cTimer* timerNext = Timers->Next(timer); -#else - cTimer* timerNext = Timers.Next(timer); -#endif + cTimer* timerNext = timers->Next(timer); DeleteTimer(timer); timer = timerNext; } else { -#if VDRVERSNUM >= 20301 - timer = Timers->Next(timer); -#else - timer = Timers.Next(timer); -#endif + timer = timers->Next(timer); } free(searchID); } else { -#if VDRVERSNUM >= 20301 - timer = Timers->Next(timer); -#else - timer = Timers.Next(timer); -#endif + timer = timers->Next(timer); } } else { -#if VDRVERSNUM >= 20301 - timer = Timers->Next(timer); -#else - timer = Timers.Next(timer); -#endif + timer = timers->Next(timer); } } } |