From 5801b4bab24421f516858bec1721db26e3720d49 Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 18 Jan 2015 12:03:06 +0100 Subject: [PATCH] fixed crash when start recording with extrecmenu or remotetimers --- HISTORY | 3 ++- displaychannel.c | 6 +++--- displaymenu.c | 8 ++++---- displaymessage.c | 6 +++--- displayreplay.c | 6 +++--- displaytracks.c | 6 +++--- displayvolume.c | 6 +++--- libcore/pixmapcontainer.c | 2 +- 8 files changed, 22 insertions(+), 21 deletions(-) diff --git a/HISTORY b/HISTORY index 248c4e3..3206339 100644 --- a/HISTORY +++ b/HISTORY @@ -150,4 +150,5 @@ Version 0.1.2 Version 0.1.3 -- added {epgname} token for recordings in currentview and detailedview. \ No newline at end of file +- added {epgname} token for recordings in currentview and detailedview. +- fixed crash when start recording with extrecmenu or remotetimers \ No newline at end of file diff --git a/displaychannel.c b/displaychannel.c index 6d5d40c..b7c5ded 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -2,6 +2,7 @@ #include "libcore/timers.h" cSDDisplayChannel::cSDDisplayChannel(cTemplate *channelTemplate, bool WithInfo) { + channelView = NULL; if (firstDisplay) { firstDisplay = false; doOutput = false; @@ -30,9 +31,8 @@ cSDDisplayChannel::cSDDisplayChannel(cTemplate *channelTemplate, bool WithInfo) } cSDDisplayChannel::~cSDDisplayChannel() { - if (!doOutput) - return; - delete channelView; + if (channelView) + delete channelView; } void cSDDisplayChannel::SetChannel(const cChannel *Channel, int Number) { diff --git a/displaymenu.c b/displaymenu.c index 2908880..2d922cd 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -2,7 +2,8 @@ #include "libcore/helpers.h" cSDDisplayMenu::cSDDisplayMenu(cTemplate *menuTemplate) { - textAreaFont = NULL; + textAreaFont = NULL; + rootView = NULL; doOutput = true; state = vsInit; pluginMenu = -1; @@ -21,9 +22,8 @@ cSDDisplayMenu::cSDDisplayMenu(cTemplate *menuTemplate) { } cSDDisplayMenu::~cSDDisplayMenu() { - if (!doOutput) - return; - delete rootView; + if (rootView) + delete rootView; if (textAreaFont) delete textAreaFont; } diff --git a/displaymessage.c b/displaymessage.c index ad3d47f..94c1bdd 100644 --- a/displaymessage.c +++ b/displaymessage.c @@ -1,6 +1,7 @@ #include "displaymessage.h" cSDDisplayMessage::cSDDisplayMessage(cTemplate *messageTemplate) { + messageView = NULL; doOutput = true; initial = true; if (!messageTemplate) { @@ -17,9 +18,8 @@ cSDDisplayMessage::cSDDisplayMessage(cTemplate *messageTemplate) { } cSDDisplayMessage::~cSDDisplayMessage() { - if (!doOutput) - return; - delete messageView; + if (messageView) + delete messageView; } void cSDDisplayMessage::SetMessage(eMessageType Type, const char *Text) { diff --git a/displayreplay.c b/displayreplay.c index 9fd8d3f..936125b 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -5,6 +5,7 @@ cSDDisplayReplay::cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly) { doOutput = true; initial = true; modeOnly = ModeOnly; + replayView = NULL; if (!replayTemplate) { doOutput = false; esyslog("skindesigner: displayReplay no valid template - aborting"); @@ -19,9 +20,8 @@ cSDDisplayReplay::cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly) { } cSDDisplayReplay::~cSDDisplayReplay() { - if (!doOutput) - return; - delete replayView; + if (replayView) + delete replayView; } void cSDDisplayReplay::SetRecording(const cRecording *Recording) { diff --git a/displaytracks.c b/displaytracks.c index 6316221..8e28095 100644 --- a/displaytracks.c +++ b/displaytracks.c @@ -4,6 +4,7 @@ cSDDisplayTracks::cSDDisplayTracks(cTemplate *audiotracksTemplate, const char *Title, int NumTracks, const char * const *Tracks) { initial = true; numTracks = NumTracks; + tracksView = NULL; doOutput = true; currentTrack = 0; menuTitle = Title; @@ -28,9 +29,8 @@ cSDDisplayTracks::cSDDisplayTracks(cTemplate *audiotracksTemplate, const char *T } cSDDisplayTracks::~cSDDisplayTracks() { - if (!doOutput) - return; - delete tracksView; + if (tracksView) + delete tracksView; } void cSDDisplayTracks::SetTrack(int Index, const char * const *Tracks) { diff --git a/displayvolume.c b/displayvolume.c index 5efa32f..9ee28a5 100644 --- a/displayvolume.c +++ b/displayvolume.c @@ -4,6 +4,7 @@ #include "libcore/helpers.h" cSDDisplayVolume::cSDDisplayVolume(cTemplate *volumeTemplate) { + volumeView = NULL; doOutput = true; initial = true; if (!volumeTemplate) { @@ -20,9 +21,8 @@ cSDDisplayVolume::cSDDisplayVolume(cTemplate *volumeTemplate) { } cSDDisplayVolume::~cSDDisplayVolume() { - if (!doOutput) - return; - delete volumeView; + if (volumeView) + delete volumeView; } void cSDDisplayVolume::SetVolume(int Current, int Total, bool Mute) { diff --git a/libcore/pixmapcontainer.c b/libcore/pixmapcontainer.c index 6cba89a..69a47ca 100644 --- a/libcore/pixmapcontainer.c +++ b/libcore/pixmapcontainer.c @@ -44,7 +44,7 @@ cPixmapContainer::~cPixmapContainer(void) { bool cPixmapContainer::CreateOsd(int Left, int Top, int Width, int Height) { if (osd) { - return true; + return false; } cOsd *newOsd = cOsdProvider::NewOsd(Left, Top); if (newOsd) {