Timer handler issue

I create a timer, there are three tasks need to do in the timer handler. First,update some data to some widgets(label or button),then clean all widgets except scr. the last, create some widgets based on request. the issue is that after one and a half hours each times, the screen widgets data is not update and can’t control, jast like the screen is static. the code as below. pls help to confirm where the issue is?


Probably it’s because you call lv_style_init() in each timer call and it leaks memory. So probably you are out of memory 1.5 hours.

You should init the style only once and just add it to an object in the lv_timer_handler_test.

Hi,kisvegabor ,thank you very much for your guidance . The issue is closed.
some days ago, I asked a question about the led widget color show, but no one replied. Could you please help to confirm this problem by the way? Below is a screenshot of the problem, you can also search for that topic based on screenshot, thanks again.

why led is not color I use lvgl ver 8.3.0 arduino ide

lv_obj_t * led1  = lv_led_create(lv_scr_act());
lv_obj_align(led1, LV_ALIGN_CENTER, -80, 0);

/*Copy the previous LED and set a brightness*/
lv_obj_t * led2  = lv_led_create(lv_scr_act());
lv_obj_align(led2, LV_ALIGN_CENTER, 0, 0);
lv_led_set_brightness(led2, 150);
lv_led_set_color(led2, lv_palette_main(LV_PALETTE_RED));

/*Copy the previous LED and switch it ON*/
lv_obj_t * led3  = lv_led_create(lv_scr_act());
lv_obj_align(led3, LV_ALIGN_CENTER, 80, 0);

Please try this: lv_obj_set_style_bg_opa(led3, LV_OPA_COVER, 0);