From 506f54b7f442659aa331f3a60480a4141aa8d01b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 31 Mar 2021 22:15:28 +0200 Subject: [PATCH] miscsettings_menu: fix - miscsettings.cpp: fix some memleaks and CPU-Menu segfault Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1192567fc6a6c0135e047d01b0b07feb78e38409 Author: Thilo Graf Date: 2021-03-31 (Wed, 31 Mar 2021) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/miscsettings_menu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 938323eef..0fc5ba060 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -340,7 +340,7 @@ int CMiscMenue::showMiscSettingsMenu() CMenuWidget misc_menue_cpu(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); if (g_info.hw_caps->can_cpufreq) { - if (cpuNotifier != NULL) + if (cpuNotifier == NULL) cpuNotifier = new CCpuFreqNotifier(); showMiscSettingsMenuCPUFreq(&misc_menue_cpu); mf = new CMenuForwarder(LOCALE_MISCSETTINGS_CPU, true, NULL, &misc_menue_cpu, NULL, CRCInput::convertDigitToKey(shortcut++)); @@ -391,7 +391,7 @@ void CMiscMenue::showMiscSettingsMenuGeneral(CMenuWidget *ms_general) //fan speed if (g_info.hw_caps->has_fan) { - if (fanNotifier != NULL) + if (fanNotifier == NULL) fanNotifier = new CFanControlNotifier(); CMenuOptionNumberChooser * mn = new CMenuOptionNumberChooser(LOCALE_FAN_SPEED, &g_settings.fan_speed, true, 1, 14, fanNotifier, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF); mn->setHint("", LOCALE_MENU_HINT_FAN_SPEED);