diff options
author | horchi <vdr@jwendel.de> | 2017-05-07 12:07:26 +0200 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2017-05-07 12:07:26 +0200 |
commit | 75ef0d7634d209a9713af62403bb08915f26fa4b (patch) | |
tree | 49dcce38ebf652709c08f5c261a76a7a15933b6d /update.c | |
parent | 65ef548b3b1e80d37da6db48e0648fc4485d14c7 (diff) | |
download | vdr-plugin-epg2vdr-75ef0d7634d209a9713af62403bb08915f26fa4b.tar.gz vdr-plugin-epg2vdr-75ef0d7634d209a9713af62403bb08915f26fa4b.tar.bz2 |
2017-05-07 version 1.1.60 (horchi)\n - bugfix: Fixed possible crash on channel lock\n\n1.1.60
Diffstat (limited to 'update.c')
-rw-r--r-- | update.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -1362,20 +1362,24 @@ void clearEpg() // Get Schedule Of //*************************************************************************** -cSchedule* getScheduleOf(tChannelID channelId, const cSchedules* schedules) +int getScheduleOf(tChannelID channelId, const cSchedules* schedules, cSchedule*& s) { cChannel* channel = 0; - cSchedule* s = 0; + + s = 0; // get channels lock #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) cStateKey channelsKey; - cChannels* channels = cChannels::GetChannelsWrite(channelsKey, 10); + cChannels* channels = cChannels::GetChannelsWrite(channelsKey, 500); #else cChannels* channels = &Channels; #endif + if (!channels) + return fail; + // get channel and schedule of channel if (channel = channels->GetByChannelID(channelId, true)) @@ -1387,7 +1391,7 @@ cSchedule* getScheduleOf(tChannelID channelId, const cSchedules* schedules) channelsKey.Remove(); #endif - return s; + return success; } //*************************************************************************** @@ -1476,7 +1480,7 @@ int cUpdate::refreshEpg(const char* forChannelId, int maxTries) tell(3, "LOCK (refreshEpg)"); #endif - if (!schedules || !timers) + if (!schedules || !timers || getScheduleOf(channelId, schedules, s) != success) { tell(3, "Info: Can't get write lock on '%s'", !schedules ? "schedules" : "timers"); @@ -1504,7 +1508,7 @@ int cUpdate::refreshEpg(const char* forChannelId, int maxTries) // lookup schedules object - if (s = getScheduleOf(channelId, schedules)) + if (s) { // ----------------------------------------- // iterate over all events of this schedule |