Merge pull request #12147 from s-hadinger/lvgl_fix_fs

LVGL fix crash in file system
This commit is contained in:
Theo Arends 2021-05-21 09:51:02 +02:00 committed by GitHub
commit 80189bf6f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -148,7 +148,9 @@ lv_fs_res_t lv_fs_close(lv_fs_file_t * file_p)
lv_fs_res_t res = file_p->drv->close_cb(file_p->drv, file_p->file_d);
lv_mem_free(file_p->file_d); /*Clean up*/
if(file_p->drv->file_size != 0) { /*Is file_d zero size?*/
lv_mem_free(file_p->file_d); /*Clean up*/
}
file_p->file_d = NULL;
file_p->drv = NULL;

View File

@ -219,7 +219,6 @@ static lv_fs_res_t lvbe_fs_open(lv_fs_drv_t * drv, void * file_p, const char * p
// AddLog(LOG_LEVEL_INFO, "LVG: F=%*_H", sizeof(f), &f);
if (f) {
File * f_ptr = new File(f); // copy to dynamic object
*f_ptr = f; // TODO is this necessary?
*((File**)file_p) = f_ptr;
return LV_FS_RES_OK;
} else {