From d30b97afa9bdbbe00680f20d3b8d90a314d7233e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 16 Oct 2012 09:13:21 +0200 Subject: [PATCH] miscsettings: prevent segfault on hardware that can't shutdown --- src/gui/miscsettings_menu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 7c3b3a697..7bd0a86fa 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -157,6 +157,7 @@ const CMenuOptionChooser::keyval_ext CPU_FREQ_OPTIONS[CPU_FREQ_OPTION_COUNT] = int CMiscMenue::showMiscSettingsMenu() { //misc settings + miscNotifier = NULL; /* for check at exit */ fanNotifier = new CFanControlNotifier(); sectionsdConfigNotifier = new CSectionsdConfigNotifier(); CMenuWidget misc_menue(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP); @@ -232,7 +233,8 @@ int CMiscMenue::showMiscSettingsMenu() int res = misc_menue.exec(NULL, ""); delete fanNotifier; delete sectionsdConfigNotifier; - delete miscNotifier; + if (miscNotifier) + delete miscNotifier; return res; }