summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY.h9
-rw-r--r--update.c16
2 files changed, 16 insertions, 9 deletions
diff --git a/HISTORY.h b/HISTORY.h
index 8779dbf..dd71073 100644
--- a/HISTORY.h
+++ b/HISTORY.h
@@ -5,8 +5,8 @@
*
*/
-#define _VERSION "1.1.59"
-#define VERSION_DATE "05.05.2017"
+#define _VERSION "1.1.60"
+#define VERSION_DATE "07.05.2017"
#define DB_API 4
@@ -19,8 +19,11 @@
/*
* ------------------------------------
+2017-05-07 version 1.1.60 (horchi)
+ - bugfix: Fixed possible crash on channel lock
+
2017-05-05 version 1.1.59 (horchi)
- - bugfix: Fixed crash on missing cahnnels
+ - bugfix: Fixed crash on missing channels
2017-05-03 version 1.1.58 (horchi)
- change: Fill timersdone table even for timers created on OSD
diff --git a/update.c b/update.c
index 1559b30..c11fc0d 100644
--- a/update.c
+++ b/update.c
@@ -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