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: f515176d41
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-03-26 (Mon, 26 Mar 2012)
This commit is contained in:
[CST] Focus
2012-03-26 14:48:50 +00:00
parent abd0c8d804
commit fdd26740e2
2 changed files with 2 additions and 8 deletions

View File

@@ -57,17 +57,13 @@ CUserMenuSetup::CUserMenuSetup(neutrino_locale_t menue_title, int menue_button)
width = w_max (40, 10); width = w_max (40, 10);
pref_name = g_settings.usermenu_text[button]; //set current button name as prefered name pref_name = g_settings.usermenu_text[button]; //set current button name as prefered name
ums = NULL; ums = NULL;
mf = NULL;
} }
CUserMenuSetup::~CUserMenuSetup() CUserMenuSetup::~CUserMenuSetup()
{ {
delete ums; delete ums;
if (mf != NULL)
delete mf;
} }
#define USERMENU_ITEM_OPTION_COUNT SNeutrinoSettings::ITEM_MAX #define USERMENU_ITEM_OPTION_COUNT SNeutrinoSettings::ITEM_MAX
const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUNT] = const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUNT] =
{ {
@@ -114,15 +110,14 @@ int CUserMenuSetup::showSetup()
}else{ }else{
//if widget not clean, ensure that we have an empty widget without any item and set the last selected item //if widget not clean, ensure that we have an empty widget without any item and set the last selected item
int sel = ums->getSelected(); int sel = ums->getSelected();
ums->resetWidget(); ums->resetWidget(true);
ums->setSelected(sel); ums->setSelected(sel);
} }
//CUserMenuNotifier *notify = new CUserMenuNotifier(); //CUserMenuNotifier *notify = new CUserMenuNotifier();
CStringInputSMS name(LOCALE_USERMENU_NAME, &g_settings.usermenu_text[button], 11, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzäöüß/- "/*, notify*/); CStringInputSMS name(LOCALE_USERMENU_NAME, &g_settings.usermenu_text[button], 11, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzäöüß/- "/*, notify*/);
if (mf == NULL) CMenuForwarder * mf = new CMenuForwarder(LOCALE_USERMENU_NAME, true, g_settings.usermenu_text[button],&name);
mf = new CMenuForwarder(LOCALE_USERMENU_NAME, true, g_settings.usermenu_text[button],&name);
//------------------------------------- //-------------------------------------
ums->addIntroItems(); ums->addIntroItems();

View File

@@ -72,7 +72,6 @@ const struct usermenu_props_t usermenu[USERMENU_ITEMS_COUNT] =
void checkButtonName(); void checkButtonName();
CMenuWidget * ums; CMenuWidget * ums;
CMenuForwarder *mf;
public: public:
CUserMenuSetup(neutrino_locale_t menue_title, int menue_button); CUserMenuSetup(neutrino_locale_t menue_title, int menue_button);