mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(sysmon): fix heap memory overflow (#7576)
This commit is contained in:
parent
51a3d93852
commit
4e52b15508
@ -105,6 +105,7 @@ void lv_sysmon_show_performance(lv_display_t * disp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(disp->perf_label == NULL) {
|
||||||
disp->perf_label = lv_sysmon_create(disp);
|
disp->perf_label = lv_sysmon_create(disp);
|
||||||
if(disp->perf_label == NULL) {
|
if(disp->perf_label == NULL) {
|
||||||
LV_LOG_WARN("Couldn't create sysmon");
|
LV_LOG_WARN("Couldn't create sysmon");
|
||||||
@ -116,6 +117,7 @@ void lv_sysmon_show_performance(lv_display_t * disp)
|
|||||||
lv_subject_add_observer_obj(&disp->perf_sysmon_backend.subject, perf_observer_cb, disp->perf_label, NULL);
|
lv_subject_add_observer_obj(&disp->perf_sysmon_backend.subject, perf_observer_cb, disp->perf_label, NULL);
|
||||||
disp->perf_sysmon_backend.timer = lv_timer_create(perf_update_timer_cb, LV_SYSMON_REFR_PERIOD_DEF, disp);
|
disp->perf_sysmon_backend.timer = lv_timer_create(perf_update_timer_cb, LV_SYSMON_REFR_PERIOD_DEF, disp);
|
||||||
lv_display_add_event_cb(disp, perf_monitor_disp_event_cb, LV_EVENT_ALL, NULL);
|
lv_display_add_event_cb(disp, perf_monitor_disp_event_cb, LV_EVENT_ALL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
#if LV_USE_PERF_MONITOR_LOG_MODE
|
#if LV_USE_PERF_MONITOR_LOG_MODE
|
||||||
lv_obj_add_flag(disp->perf_label, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(disp->perf_label, LV_OBJ_FLAG_HIDDEN);
|
||||||
@ -147,6 +149,7 @@ void lv_sysmon_show_memory(lv_display_t * disp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(disp->mem_label == NULL) {
|
||||||
disp->mem_label = lv_sysmon_create(disp);
|
disp->mem_label = lv_sysmon_create(disp);
|
||||||
if(disp->mem_label == NULL) {
|
if(disp->mem_label == NULL) {
|
||||||
LV_LOG_WARN("Couldn't create sysmon");
|
LV_LOG_WARN("Couldn't create sysmon");
|
||||||
@ -155,6 +158,7 @@ void lv_sysmon_show_memory(lv_display_t * disp)
|
|||||||
|
|
||||||
lv_obj_align(disp->mem_label, LV_USE_MEM_MONITOR_POS, 0, 0);
|
lv_obj_align(disp->mem_label, LV_USE_MEM_MONITOR_POS, 0, 0);
|
||||||
lv_subject_add_observer_obj(&sysmon_mem.subject, mem_observer_cb, disp->mem_label, NULL);
|
lv_subject_add_observer_obj(&sysmon_mem.subject, mem_observer_cb, disp->mem_label, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
lv_obj_remove_flag(disp->mem_label, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_remove_flag(disp->mem_label, LV_OBJ_FLAG_HIDDEN);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user