mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-31 07:56:23 +08:00
@@ -390,6 +390,12 @@ static void obj_del_core(lv_obj_t * obj)
|
|||||||
indev = lv_indev_get_next(indev);
|
indev = lv_indev_get_next(indev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Delete all pending async del-s*/
|
||||||
|
lv_res_t async_cancel_res = LV_RES_OK;
|
||||||
|
while(async_cancel_res == LV_RES_OK) {
|
||||||
|
async_cancel_res = lv_async_call_cancel(lv_obj_del_async_cb, obj);
|
||||||
|
}
|
||||||
|
|
||||||
/*All children deleted. Now clean up the object specific data*/
|
/*All children deleted. Now clean up the object specific data*/
|
||||||
_lv_obj_destruct(obj);
|
_lv_obj_destruct(obj);
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -98,8 +98,11 @@ lv_res_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data)
|
|||||||
|
|
||||||
static void lv_async_timer_cb(lv_timer_t * timer)
|
static void lv_async_timer_cb(lv_timer_t * timer)
|
||||||
{
|
{
|
||||||
|
/*Save the info because an lv_async_call_cancel might delete it in the callback*/
|
||||||
lv_async_info_t * info = (lv_async_info_t *)timer->user_data;
|
lv_async_info_t * info = (lv_async_info_t *)timer->user_data;
|
||||||
|
lv_async_info_t info_save = *info;
|
||||||
info->cb(info->user_data);
|
lv_timer_del(timer);
|
||||||
lv_free(info);
|
lv_free(info);
|
||||||
|
|
||||||
|
info_save.cb(info_save.user_data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user