miscsettings_menu: fix - miscsettings.cpp: fix some memleaks and CPU-Menu segfault

Origin commit data
------------------
Branch: ni/coolstream
Commit: 1192567fc6
Author: Thilo Graf <dbt@novatux.de>
Date: 2021-03-31 (Wed, 31 Mar 2021)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2021-03-31 22:15:28 +02:00
committed by vanhofen
parent 14fa711bd1
commit 506f54b7f4

View File

@@ -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);