fix(obj): check obj->is_deleting at the beginning of obj_del_core (#4525)
Signed-off-by: wangxuedong <wangxuedong@xiaomi.com>
This commit is contained in:
@@ -372,12 +372,15 @@ static void lv_obj_del_async_cb(void * obj)
|
||||
|
||||
static void obj_del_core(lv_obj_t * obj)
|
||||
{
|
||||
if(obj->is_deleting)
|
||||
return;
|
||||
|
||||
obj->is_deleting = true;
|
||||
|
||||
/*Let the user free the resources used in `LV_EVENT_DELETE`*/
|
||||
lv_res_t res = lv_obj_send_event(obj, LV_EVENT_DELETE, NULL);
|
||||
if(res == LV_RES_INV) return;
|
||||
|
||||
obj->is_deleting = true;
|
||||
|
||||
/*Clean registered event_cb*/
|
||||
uint32_t event_cnt = lv_obj_get_event_count(obj);
|
||||
for(uint32_t i = 0; i < event_cnt; i++) {
|
||||
|
||||
Reference in New Issue
Block a user