From 9463f8aa7da7e14fae0996e8f46413f0cebaff8c Mon Sep 17 00:00:00 2001 From: CTCaer Date: Fri, 4 Oct 2024 22:14:23 +0300 Subject: [PATCH] nyx: fix memleak when 10 launcher items are shown --- nyx/nyx_gui/frontend/gui.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nyx/nyx_gui/frontend/gui.c b/nyx/nyx_gui/frontend/gui.c index 9ba72fe..7ed7954 100644 --- a/nyx/nyx_gui/frontend/gui.c +++ b/nyx/nyx_gui/frontend/gui.c @@ -1440,15 +1440,15 @@ static lv_res_t _launch_more_cfg_action(lv_obj_t *btn) static lv_res_t _win_launch_close_action(lv_obj_t * btn) { // Cleanup icons. - for (u32 i = 0; i < 8; i++) + for (u32 i = 0; i < (n_cfg.entries_5_col ? 10 : 8); i++) { - lv_obj_t *btn = launch_ctxt.btn[i]; - lv_btn_ext_t *ext = lv_obj_get_ext_attr(btn); + lv_obj_t *btns = launch_ctxt.btn[i]; + lv_btn_ext_t *ext = lv_obj_get_ext_attr(btns); if (ext->idx) { // This gets latest object, which is the button overlay. So iterate 2 times. - lv_obj_t * img = lv_obj_get_child(btn, NULL); - img = lv_obj_get_child(btn, img); + lv_obj_t * img = lv_obj_get_child(btns, NULL); + img = lv_obj_get_child(btns, img); lv_img_dsc_t *src = (lv_img_dsc_t *)lv_img_get_src(img);