Merge pull request #695 from marsman7/feature-qrcode

fix: improve memory leaks on delete qrcode
This commit is contained in:
fvanroie 2024-04-01 15:48:34 +02:00 committed by GitHub
commit e641a244c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 1 deletions

View File

@ -321,7 +321,6 @@ void lv_qrcode_delete(lv_obj_t* qrcode)
lv_img_dsc_t* img = lv_canvas_get_img(qrcode);
lv_mem_free(img->data);
lv_mem_free(img);
lv_obj_del(qrcode);
}
/**********************

View File

@ -381,6 +381,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
case HASP_OBJ_QRCODE:
obj = lv_qrcode_create(parent_obj, 140, LV_COLOR_BLACK, LV_COLOR_WHITE);
if(obj) {
lv_obj_set_event_cb(obj, delete_event_handler);
obj->user_data.objid = LV_HASP_QRCODE;
}
break;