From 36bbab989980a025b4808ee71ca8d2f01831e508 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 16 Oct 2014 13:38:26 +0400 Subject: [PATCH] gui/update_menue.cpp: fix crash in dtor, CMenuForwarder is deleted on menu delete Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/37891d2de3ce74056f5b195da293d3b4bd2ccf98 Author: [CST] Focus Date: 2014-10-16 (Thu, 16 Oct 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/update_menue.cpp | 12 ++---------- src/gui/update_menue.h | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/gui/update_menue.cpp b/src/gui/update_menue.cpp index bc0f6536f..1978b885f 100644 --- a/src/gui/update_menue.cpp +++ b/src/gui/update_menue.cpp @@ -51,13 +51,11 @@ CSoftwareUpdate::CSoftwareUpdate() { width = w_max (40, 10); fe = new CFlashExpert(); - update_item = NULL; } CSoftwareUpdate::~CSoftwareUpdate() { delete fe; - delete update_item; } int CSoftwareUpdate::exec(CMenuTarget* parent, const std::string &/*actionKey*/) @@ -82,14 +80,8 @@ int CSoftwareUpdate::showSoftwareUpdate() //flashing CFlashUpdate flash; -#if 0 - neutrino_locale_t up_text = (g_settings.softupdate_mode == 0) ? LOCALE_FLASHUPDATE_CHECKUPDATE_LOCAL : LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET; - update_item = new CMenuForwarder(up_text, true, NULL, &flash, NULL, CRCInput::RC_red); - update_item->setHint("", LOCALE_MENU_HINT_SOFTUPDATE_CHECK); - softUpdate.addItem(update_item); -#endif - update_item = new CMenuForwarder(LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET, true, NULL, &flash, "inet", CRCInput::RC_red); + CMenuForwarder *update_item = new CMenuForwarder(LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET, true, NULL, &flash, "inet", CRCInput::RC_red); update_item->setHint("", LOCALE_MENU_HINT_SOFTUPDATE_CHECK); softUpdate.addItem(update_item); @@ -97,7 +89,7 @@ int CSoftwareUpdate::showSoftwareUpdate() update_item->setHint("", LOCALE_MENU_HINT_SOFTUPDATE_CHECK_LOCAL); softUpdate.addItem(update_item); - CUpdateSettings update_settings(update_item); + CUpdateSettings update_settings; CMenuWidget mtdexpert(LOCALE_FLASHUPDATE_EXPERTFUNCTIONS, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_MTDEXPERT); //settings if (!g_settings.easymenu) { diff --git a/src/gui/update_menue.h b/src/gui/update_menue.h index 5daf34f38..aaae8af8c 100644 --- a/src/gui/update_menue.h +++ b/src/gui/update_menue.h @@ -40,7 +40,6 @@ class CSoftwareUpdate : public CMenuTarget { private: int width; - CMenuForwarder * update_item; int showSoftwareUpdate(); void showSoftwareUpdateExpert(CMenuWidget *w_mtd_expert);