gui/miscsettings_menu.cpp: fix memleak - CMiscNotifier

This commit is contained in:
[CST] Focus
2012-05-07 16:10:20 +04:00
parent 78ac46c1b2
commit cfdf7b0c69
2 changed files with 3 additions and 1 deletions

View File

@@ -214,6 +214,7 @@ int CMiscMenue::showMiscSettingsMenu()
int res = misc_menue.exec(NULL, ""); int res = misc_menue.exec(NULL, "");
delete fanNotifier; delete fanNotifier;
delete sectionsdConfigNotifier; delete sectionsdConfigNotifier;
delete miscNotifier;
return res; return res;
} }
@@ -254,7 +255,7 @@ void CMiscMenue::showMiscSettingsMenuEnergy(CMenuWidget *ms_energy)
CStringInput * miscSettings_shutdown_count = new CStringInput(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, g_settings.shutdown_count, 3, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT1, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT2, "0123456789 "); CStringInput * miscSettings_shutdown_count = new CStringInput(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, g_settings.shutdown_count, 3, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT1, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT2, "0123456789 ");
CMenuForwarder *m2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, !g_settings.shutdown_real, g_settings.shutdown_count, miscSettings_shutdown_count); CMenuForwarder *m2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, !g_settings.shutdown_real, g_settings.shutdown_count, miscSettings_shutdown_count);
CMiscNotifier* miscNotifier = new CMiscNotifier( m1, m2 ); miscNotifier = new CMiscNotifier( m1, m2 );
ms_energy->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_SHUTDOWN_REAL, &g_settings.shutdown_real, OPTIONS_OFF1_ON0_OPTIONS, OPTIONS_OFF1_ON0_OPTION_COUNT, true, miscNotifier)); ms_energy->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_SHUTDOWN_REAL, &g_settings.shutdown_real, OPTIONS_OFF1_ON0_OPTIONS, OPTIONS_OFF1_ON0_OPTION_COUNT, true, miscNotifier));
ms_energy->addItem(m1); ms_energy->addItem(m1);

View File

@@ -41,6 +41,7 @@ class CMiscMenue : public CMenuTarget
private: private:
CFanControlNotifier *fanNotifier; CFanControlNotifier *fanNotifier;
CSectionsdConfigNotifier* sectionsdConfigNotifier; CSectionsdConfigNotifier* sectionsdConfigNotifier;
CMiscNotifier* miscNotifier;
int width; int width;