From fdd26740e219ebc683dfa83c59e37c6db132eab9 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 26 Mar 2012 14:48:50 +0000 Subject: [PATCH] gui/user_menue_setup.cpp: use CMenuWidget::resetWidget(true) to fix memleaks git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2162 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f515176d415d9b4eef2d59f788313101d81021a1 Author: [CST] Focus Date: 2012-03-26 (Mon, 26 Mar 2012) --- src/gui/user_menue_setup.cpp | 9 ++------- src/gui/user_menue_setup.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index a2e371b16..d43b0a4b6 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -57,17 +57,13 @@ CUserMenuSetup::CUserMenuSetup(neutrino_locale_t menue_title, int menue_button) width = w_max (40, 10); pref_name = g_settings.usermenu_text[button]; //set current button name as prefered name ums = NULL; - mf = NULL; } CUserMenuSetup::~CUserMenuSetup() { delete ums; - if (mf != NULL) - delete mf; } - #define USERMENU_ITEM_OPTION_COUNT SNeutrinoSettings::ITEM_MAX const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUNT] = { @@ -114,15 +110,14 @@ int CUserMenuSetup::showSetup() }else{ //if widget not clean, ensure that we have an empty widget without any item and set the last selected item int sel = ums->getSelected(); - ums->resetWidget(); + ums->resetWidget(true); ums->setSelected(sel); } //CUserMenuNotifier *notify = new CUserMenuNotifier(); CStringInputSMS name(LOCALE_USERMENU_NAME, &g_settings.usermenu_text[button], 11, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzäöüß/- "/*, notify*/); - if (mf == NULL) - mf = new CMenuForwarder(LOCALE_USERMENU_NAME, true, g_settings.usermenu_text[button],&name); + CMenuForwarder * mf = new CMenuForwarder(LOCALE_USERMENU_NAME, true, g_settings.usermenu_text[button],&name); //------------------------------------- ums->addIntroItems(); diff --git a/src/gui/user_menue_setup.h b/src/gui/user_menue_setup.h index eb80bd486..5c04d9986 100644 --- a/src/gui/user_menue_setup.h +++ b/src/gui/user_menue_setup.h @@ -72,7 +72,6 @@ const struct usermenu_props_t usermenu[USERMENU_ITEMS_COUNT] = void checkButtonName(); CMenuWidget * ums; - CMenuForwarder *mf; public: CUserMenuSetup(neutrino_locale_t menue_title, int menue_button);