diff --git a/coreengine/listelements.c b/coreengine/listelements.c index 9d7a3d0..0e25dc7 100644 --- a/coreengine/listelements.c +++ b/coreengine/listelements.c @@ -1658,7 +1658,9 @@ void cLeMenuRecordings::ClearCurrentElement(void) { } void cLeMenuRecordings::Set(const cRecording *recording, int level, int total, int New) { - this->recording = new cRecording(recording->FileName()); + if (!this->recording) { + this->recording = new cRecording(recording->FileName()); + } this->level = level; this->total = total; this->New = New; @@ -1787,6 +1789,18 @@ void cLeMenuRecordings::RenderCurrent(void) { currentRecording->Parse(); } +void cLeMenuRecordings::Clear(bool forceClearBackground) { + delete recording; + recording = NULL; + cListElement::Clear(forceClearBackground); +} + +void cLeMenuRecordings::Close(void) { + delete recording; + recording = NULL; + cListElement::Close(); +} + char *cLeMenuRecordings::RecName(const char *path, int level) { char *recName; const char *startName = path; diff --git a/coreengine/listelements.h b/coreengine/listelements.h index d76bb2e..30dcb6b 100644 --- a/coreengine/listelements.h +++ b/coreengine/listelements.h @@ -40,7 +40,7 @@ public: bool DoScroll(void) { return current; }; void Render(void); virtual void RenderCurrent(void) { }; - void Close(void); + virtual void Close(void); int ListShiftTime(void) { return ShiftTime(); }; int ShiftDistance(void); eOrientation ShiftOrientation(void); @@ -283,6 +283,8 @@ public: void Set(const cRecording *recording, int level, int total, int New); bool Parse(bool forced = true); void RenderCurrent(void); + void Clear(bool forceClearBackground = false); + void Close(void); }; /******************************************************************