From 69c312daacac4e46b069ca4f921cc3e162e21f66 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Wed, 23 Mar 2022 00:55:18 +0200 Subject: [PATCH] nyx: clear B button context on option actions Fixes an issue that was causing an NULL pointer dereference when a certain access path was followed --- nyx/nyx_gui/frontend/gui_options.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nyx/nyx_gui/frontend/gui_options.c b/nyx/nyx_gui/frontend/gui_options.c index 319c0c9..def291b 100644 --- a/nyx/nyx_gui/frontend/gui_options.c +++ b/nyx/nyx_gui/frontend/gui_options.c @@ -122,7 +122,6 @@ lv_obj_t *create_window_autoboot(const char *win_title) return win; } -// TODO: instant update of button for these. static lv_res_t _autoboot_disable_action(lv_obj_t *btn) { h_cfg.autoboot = 0; @@ -136,6 +135,8 @@ static lv_res_t _autoboot_disable_action(lv_obj_t *btn) lv_obj_del(win); + close_btn = NULL; + return LV_RES_OK; } @@ -155,6 +156,8 @@ static lv_res_t _autoboot_enable_main_action(lv_obj_t *btn) obj = lv_obj_get_parent(obj); lv_obj_del(obj); + close_btn = NULL; + return LV_RES_INV; } @@ -172,6 +175,8 @@ static lv_res_t _autoboot_enable_more_action(lv_obj_t *btn) obj = lv_obj_get_parent(obj); lv_obj_del(obj); + close_btn = NULL; + return LV_RES_INV; }