1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(tabview): fix warning

This commit is contained in:
Gabor Kiss-Vamosi 2023-07-10 19:54:41 +02:00
parent 416b26771b
commit 223dc1cf9d

View File

@ -129,9 +129,9 @@ void lv_tabview_rename_tab(lv_obj_t * obj, uint32_t id, const char * new_name)
if(id >= tabview->tab_cnt) return;
if(tabview->tab_pos & LV_DIR_HOR) id *= 2;
lv_mem_free(tabview->map[id]);
lv_mem_free((void*)tabview->map[id]);
tabview->map[id] = lv_mem_alloc(strlen(new_name) + 1);
strcpy(tabview->map[id], new_name);
strcpy((void*)tabview->map[id], new_name);
lv_obj_invalidate(obj);
}
@ -273,13 +273,13 @@ static void lv_tabview_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj
uint32_t i;
if(tabview->tab_pos & LV_DIR_VER) {
for(i = 0; i < tabview->tab_cnt; i++) {
lv_mem_free(tabview->map[i]);
lv_mem_free((void*)tabview->map[i]);
tabview->map[i] = NULL;
}
}
if(tabview->tab_pos & LV_DIR_HOR) {
for(i = 0; i < tabview->tab_cnt; i++) {
lv_mem_free(tabview->map[i * 2]);
lv_mem_free((void*)tabview->map[i * 2]);
tabview->map[i * 2] = NULL;
}
}