mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
gui/osdlang_setup.cpp: fix memleak
This commit is contained in:
@@ -59,6 +59,7 @@ COsdLangSetup::COsdLangSetup(bool wizard_mode)
|
|||||||
is_wizard = wizard_mode;
|
is_wizard = wizard_mode;
|
||||||
|
|
||||||
width = w_max (45, 10);
|
width = w_max (45, 10);
|
||||||
|
tzNotifier = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
COsdLangSetup::~COsdLangSetup()
|
COsdLangSetup::~COsdLangSetup()
|
||||||
@@ -96,6 +97,7 @@ int COsdLangSetup::showLocalSetup()
|
|||||||
localSettings->addItem(mf);
|
localSettings->addItem(mf);
|
||||||
|
|
||||||
//timezone setup
|
//timezone setup
|
||||||
|
tzNotifier = new CTZChangeNotifier();
|
||||||
CMenuOptionStringChooser* tzSelect = getTzItems();
|
CMenuOptionStringChooser* tzSelect = getTzItems();
|
||||||
if (tzSelect != NULL)
|
if (tzSelect != NULL)
|
||||||
localSettings->addItem(tzSelect);
|
localSettings->addItem(tzSelect);
|
||||||
@@ -114,6 +116,7 @@ int COsdLangSetup::showLocalSetup()
|
|||||||
int res = localSettings->exec(NULL, "");
|
int res = localSettings->exec(NULL, "");
|
||||||
delete localSettings;
|
delete localSettings;
|
||||||
delete langNotifier;
|
delete langNotifier;
|
||||||
|
delete tzNotifier;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +129,7 @@ CMenuOptionStringChooser* COsdLangSetup::getTzItems()
|
|||||||
CMenuOptionStringChooser* tzSelect = NULL;
|
CMenuOptionStringChooser* tzSelect = NULL;
|
||||||
if (parser != NULL)
|
if (parser != NULL)
|
||||||
{
|
{
|
||||||
tzSelect = new CMenuOptionStringChooser(LOCALE_MAINSETTINGS_TIMEZONE, g_settings.timezone, true, new CTZChangeNotifier(), CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN, true);
|
tzSelect = new CMenuOptionStringChooser(LOCALE_MAINSETTINGS_TIMEZONE, g_settings.timezone, true, tzNotifier, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN, true);
|
||||||
tzSelect->setHint("", LOCALE_MENU_HINT_TIMEZONE);
|
tzSelect->setHint("", LOCALE_MENU_HINT_TIMEZONE);
|
||||||
xmlNodePtr search = xmlDocGetRootElement(parser)->xmlChildrenNode;
|
xmlNodePtr search = xmlDocGetRootElement(parser)->xmlChildrenNode;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
@@ -54,6 +54,7 @@ class COsdLangSetup : public CMenuTarget, CChangeObserver
|
|||||||
int width;
|
int width;
|
||||||
|
|
||||||
bool is_wizard;
|
bool is_wizard;
|
||||||
|
CTZChangeNotifier * tzNotifier;
|
||||||
|
|
||||||
int showLocalSetup();
|
int showLocalSetup();
|
||||||
void showPrefMenu(CMenuWidget *prefMenu, CLangSelectNotifier *langNotifier);
|
void showPrefMenu(CMenuWidget *prefMenu, CLangSelectNotifier *langNotifier);
|
||||||
|
Reference in New Issue
Block a user