From 6a03b80df7f18ebb06f160fbe1d2ef3061c4b97a Mon Sep 17 00:00:00 2001 From: anbr Date: Sun, 2 Apr 2017 15:16:49 +0200 Subject: Fix: release every lock=Schedules (Closes: #2487) --- watch.c | 60 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/watch.c b/watch.c index 3ea9b60..7f3d6df 100644 --- a/watch.c +++ b/watch.c @@ -286,7 +286,7 @@ void ciMonWatch::Action(void) if(!bSuspend) { // every second the clock need updates. if((0 == (nCnt % 5))) { - if (theSetup.m_nRenderMode == eRenderMode_DualLine) { + if (theSetup.m_nRenderMode == eRenderMode_DualLine) { bReDraw |= CurrentTime(); } if(m_eWatchMode != eLiveTV) { @@ -723,7 +723,7 @@ eReplayState ciMonWatch::ReplayMode() const { bool Play = false, Forward = false; int Speed = -1; - if (m_pControl + if (m_pControl && ((cControl *)m_pControl)->GetReplayMode(Play,Forward,Speed)) { // 'Play' tells whether we are playing or pausing, 'Forward' tells whether @@ -859,11 +859,11 @@ void ciMonWatch::Channel(int ChannelNumber) const cChannel * ch = NULL; #if APIVERSNUM >= 20302 - cStateKey lock; - if (const cChannels *Channels = cChannels::GetChannelsRead(lock)) { - ch = Channels->GetByNumber(ChannelNumber); - lock.Remove(); - } + cStateKey lock; + if (const cChannels *Channels = cChannels::GetChannelsRead(lock)) { + ch = Channels->GetByNumber(ChannelNumber); + lock.Remove(); + } #else ch = Channels.GetByNumber(ChannelNumber); #endif @@ -895,29 +895,31 @@ bool ciMonWatch::Program() { cSchedulesLock lock; const cSchedules * schedules = cSchedules::Schedules(lock); #endif - if (chID.Valid() && schedules) { - const cSchedule * schedule = schedules->GetSchedule(chID); - if (schedule && (p = schedule->GetPresentEvent()) != NULL) { - if(!chPresentTime || chEventID != p->EventID()) { - bChanged = true; - chEventID = p->EventID(); - chPresentTime = p->StartTime(); - chFollowingTime = p->EndTime(); - - if(chPresentTitle) { - delete chPresentTitle; - chPresentTitle = NULL; - } - if (!isempty(p->Title())) { - chPresentTitle = new cString(p->Title()); - } + if (schedules) { + if (chID.Valid()) { + const cSchedule * schedule = schedules->GetSchedule(chID); + if (schedule && (p = schedule->GetPresentEvent()) != NULL) { + if(!chPresentTime || chEventID != p->EventID()) { + bChanged = true; + chEventID = p->EventID(); + chPresentTime = p->StartTime(); + chFollowingTime = p->EndTime(); + + if(chPresentTitle) { + delete chPresentTitle; + chPresentTitle = NULL; + } + if (!isempty(p->Title())) { + chPresentTitle = new cString(p->Title()); + } - if(chPresentShortTitle) { - delete chPresentShortTitle; - chPresentShortTitle = NULL; - } - if (!isempty(p->ShortText())) { - chPresentShortTitle = new cString(p->ShortText()); + if(chPresentShortTitle) { + delete chPresentShortTitle; + chPresentShortTitle = NULL; + } + if (!isempty(p->ShortText())) { + chPresentShortTitle = new cString(p->ShortText()); + } } } } -- cgit v1.2.3