From 2bc29e89f6d63f4dfd68c9e928884d71e2bd6577 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 7 May 2012 12:15:00 +0400 Subject: [PATCH] gui/videosettings.cpp: fix memleak - CAutoModeNotifier --- src/gui/videosettings.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 8d796e186..835953af3 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -217,10 +217,10 @@ int CVideoSettings::showVideoSetup() CMenuWidget videomodes(LOCALE_MAINSETTINGS_VIDEO, NEUTRINO_ICON_SETTINGS); videomodes.addIntroItems(LOCALE_VIDEOMENU_ENABLED_MODES); - CAutoModeNotifier * anotify = new CAutoModeNotifier(); + CAutoModeNotifier anotify; for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) - videomodes.addItem(new CMenuOptionChooser(VIDEOMENU_VIDEOMODE_OPTIONS[i].valname, &g_settings.enabled_video_modes[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, anotify)); - //anotify->changeNotify(NONEXISTANT_LOCALE, 0); + videomodes.addItem(new CMenuOptionChooser(VIDEOMENU_VIDEOMODE_OPTIONS[i].valname, &g_settings.enabled_video_modes[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, &anotify)); + //anotify.changeNotify(NONEXISTANT_LOCALE, 0); CMenuForwarder * vs_videomodes_fw = new CMenuForwarder(LOCALE_VIDEOMENU_ENABLED_MODES, true, NULL, &videomodes, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED ); @@ -275,9 +275,8 @@ void CVideoSettings::setVideoSettings() videoDecoder->setAspectRatio(g_settings.video_Format, g_settings.video_43mode); videoDecoder->SetDBDR(g_settings.video_dbdr); - CAutoModeNotifier * anotify = new CAutoModeNotifier(); - anotify->changeNotify(NONEXISTANT_LOCALE, 0); - delete anotify; + CAutoModeNotifier anotify; + anotify.changeNotify(NONEXISTANT_LOCALE, 0); } void CVideoSettings::setupVideoSystem(bool do_ask)