From adb26fac248a9010dba35dd7c3a300fdc31912f0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 23 Dec 2016 02:01:09 +0100 Subject: [PATCH] Cleanup general_write_handler --- menu/menu_setting.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 14e5f00c89..8b8f50333d 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -1537,8 +1537,6 @@ void general_write_handler(void *data) enum event_command rarch_cmd = CMD_EVENT_NONE; rarch_setting_t *setting = (rarch_setting_t*)data; settings_t *settings = config_get_ptr(); - global_t *global = global_get_ptr(); - file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); if (!setting) return; @@ -1595,6 +1593,7 @@ void general_write_handler(void *data) if (*setting->value.target.boolean) { menu_displaylist_info_t info = {0}; + file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); info.list = menu_stack; info.type = 0; @@ -1687,10 +1686,13 @@ void general_write_handler(void *data) rarch_cmd = CMD_EVENT_AUDIO_REINIT; break; case MENU_ENUM_LABEL_PAL60_ENABLE: - if (*setting->value.target.boolean && global->console.screen.pal_enable) - rarch_cmd = CMD_EVENT_REINIT; - else - setting_set_with_string_representation(setting, "false"); + { + global_t *global = global_get_ptr(); + if (*setting->value.target.boolean && global->console.screen.pal_enable) + rarch_cmd = CMD_EVENT_REINIT; + else + setting_set_with_string_representation(setting, "false"); + } break; case MENU_ENUM_LABEL_SYSTEM_BGM_ENABLE: if (*setting->value.target.boolean)