diff --git a/src/gui/daemon_control.cpp b/src/gui/daemon_control.cpp index 8b58f8272..1943a9f99 100644 --- a/src/gui/daemon_control.cpp +++ b/src/gui/daemon_control.cpp @@ -88,6 +88,7 @@ int CDaemonControlMenu::show() daemonControlMenu->addIntroItems(); CMenuOptionChooser *mc; + CFlagFileNotifier * flagFileNotifier[DAEMONS_COUNT]; for (unsigned int i = 0; i < DAEMONS_COUNT; i++) { buf.str(""); @@ -96,15 +97,18 @@ int CDaemonControlMenu::show() daemons_data[i].flag_exist = file_exists(flagfile); - CFlagFileNotifier * flagFileNotifier = new CFlagFileNotifier(daemons_data[i].flag); + flagFileNotifier[i] = new CFlagFileNotifier(daemons_data[i].flag); - mc = new CMenuOptionChooser(daemons_data[i].name, &daemons_data[i].flag_exist, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, flagFileNotifier, CRCInput::convertDigitToKey(daemon_shortcut++)); + mc = new CMenuOptionChooser(daemons_data[i].name, &daemons_data[i].flag_exist, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, flagFileNotifier[i], CRCInput::convertDigitToKey(daemon_shortcut++)); mc->setHint(daemons_data[i].icon, daemons_data[i].desc); daemonControlMenu->addItem(mc); } int res = daemonControlMenu->exec(NULL,""); daemonControlMenu->hide(); + for (unsigned int i = 0; i < DAEMONS_COUNT; i++) + delete flagFileNotifier[i]; + delete daemonControlMenu; return res; } @@ -172,6 +176,7 @@ int CCamdControlMenu::show() camdControlMenu->addItem(GenericMenuSeparatorLine); CMenuOptionChooser *mc; + CFlagFileNotifier * flagFileNotifier[CAMDS_COUNT]; for (unsigned int i = 0; i < CAMDS_COUNT; i++) { std::string vinfo = ""; @@ -214,14 +219,17 @@ int CCamdControlMenu::show() std::string hint(g_Locale->getText(camds_data[i].desc)); hint.append("\nvinfo: " + vinfo); - CFlagFileNotifier * flagFileNotifier = new CFlagFileNotifier(camds_data[i].camd_file); + flagFileNotifier[i] = new CFlagFileNotifier(camds_data[i].camd_file); - mc = new CMenuOptionChooser(camds_data[i].name, &camds_data[i].camd_runs, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, camds_data[i].camd_exist, flagFileNotifier, CRCInput::convertDigitToKey(camd_shortcut++)); + mc = new CMenuOptionChooser(camds_data[i].name, &camds_data[i].camd_runs, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, camds_data[i].camd_exist, flagFileNotifier[i], CRCInput::convertDigitToKey(camd_shortcut++)); mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, hint); camdControlMenu->addItem(mc); } int res = camdControlMenu->exec(NULL,""); camdControlMenu->hide(); + for (unsigned int i = 0; i < CAMDS_COUNT; i++) + delete flagFileNotifier[i]; + delete camdControlMenu; return res; } diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 8ffb65845..1d307f26e 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -728,12 +728,14 @@ _show_menu: } //NI + int fake_hddpower = 0; + CTouchFileNotifier * hddpowerNotifier = NULL; hddmenu->addItem(new CMenuSeparator()); if (cs_get_revision() < 8) { //NI HDD power (HD1/BSE only) const char *flag_hddpower = FLAGDIR "/.hddpower"; - int fake_hddpower = file_exists(flag_hddpower); - CTouchFileNotifier * hddpowerNotifier = new CTouchFileNotifier(flag_hddpower); + fake_hddpower = file_exists(flag_hddpower); + hddpowerNotifier = new CTouchFileNotifier(flag_hddpower); mc = new CMenuOptionChooser(LOCALE_HDD_POWER, &fake_hddpower, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, hddpowerNotifier, CRCInput::RC_yellow); mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_HDD_POWER); hddmenu->addItem(mc); @@ -797,7 +799,8 @@ _show_menu: } int ret = hddmenu->exec(NULL, ""); - + if (hddpowerNotifier) + delete hddpowerNotifier; delete hddmenu; hdd_list.clear(); devtitle.clear(); diff --git a/src/gui/infoicons_setup.cpp b/src/gui/infoicons_setup.cpp index f66aaf716..317c0629c 100644 --- a/src/gui/infoicons_setup.cpp +++ b/src/gui/infoicons_setup.cpp @@ -210,6 +210,8 @@ int CInfoIconsSetup::menu() infoiconsMenu->hide(); delete infoiconsMenu; delete delFlagMenu; + for (int i = 0 ; i < MODE_ICONS_NR_OF_ENTRIES; i++) + delete flagchooser[i]; delete flagMenu; return res; } diff --git a/src/gui/lcd4l_setup.cpp b/src/gui/lcd4l_setup.cpp index c8c4f847d..1b465696b 100644 --- a/src/gui/lcd4l_setup.cpp +++ b/src/gui/lcd4l_setup.cpp @@ -166,6 +166,8 @@ int CLCD4lSetup::show() int res = lcd4lSetup->exec(NULL, ""); lcd4lSetup->hide(); + delete lcd_clock_a; + delete lcd_weather; delete lcd4lSetup; // the things to do on exit