From cc1efd1d2e9507c5b4619f58938974d35cfff69d Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 24 Sep 2016 14:25:58 +0200 Subject: [PATCH] fixed crash when replacing recording menu with extrecmenu --- coreengine/listelements.c | 4 +++- coreengine/viewdisplaymenu.c | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/coreengine/listelements.c b/coreengine/listelements.c index 3b2037f..9d7a3d0 100644 --- a/coreengine/listelements.c +++ b/coreengine/listelements.c @@ -1610,6 +1610,7 @@ cLeMenuRecordings::cLeMenuRecordings(const cLeMenuRecordings &other) : cListElem } cLeMenuRecordings::~cLeMenuRecordings(void) { + delete recording; } void cLeMenuRecordings::SetTokenContainer(void) { @@ -1657,7 +1658,7 @@ void cLeMenuRecordings::ClearCurrentElement(void) { } void cLeMenuRecordings::Set(const cRecording *recording, int level, int total, int New) { - this->recording = recording; + this->recording = new cRecording(recording->FileName()); this->level = level; this->total = total; this->New = New; @@ -1841,6 +1842,7 @@ cCeMenuRecordings::cCeMenuRecordings(void) { } cCeMenuRecordings::~cCeMenuRecordings(void) { + delete recording; } void cCeMenuRecordings::SetTokenContainer(void) { diff --git a/coreengine/viewdisplaymenu.c b/coreengine/viewdisplaymenu.c index 88ad756..783cf2d 100644 --- a/coreengine/viewdisplaymenu.c +++ b/coreengine/viewdisplaymenu.c @@ -535,10 +535,12 @@ bool cViewMenu::Init(void) { } void cViewMenu::Close(void) { - animator->Stop(); - animator->Finish(); - delete animator; - animator = NULL; + if (animator) { + animator->Stop(); + animator->Finish(); + delete animator; + animator = NULL; + } for (int i=0; i < numSubviews; i++) { if (subViews[i]) { subViews[i]->Close();