From 6fef6fa29a61d695d4a2b2c6ad54efbb7b22c62f Mon Sep 17 00:00:00 2001 From: xianjimli Date: Wed, 19 Dec 2018 11:37:59 +0800 Subject: [PATCH] fix widget_animator_manager_time_elapse use freed memory bug --- docs/changes.md | 1 + src/base/widget_animator_manager.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changes.md b/docs/changes.md index 0b5c88065..875a17baf 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -2,6 +2,7 @@ * 2018/12/19 * 修改combobox弹出窗口位置的BUG。 + * 修改widget\_animator\_manager中野指针的问题(感谢陈谭提供补丁)。 * 2018/12/18 * widget\_destroy自动判断是否需要异步销毁。 diff --git a/src/base/widget_animator_manager.c b/src/base/widget_animator_manager.c index bfc9764da..5d7327104 100644 --- a/src/base/widget_animator_manager.c +++ b/src/base/widget_animator_manager.c @@ -32,8 +32,10 @@ ret_t widget_animator_manager_time_elapse(widget_animator_manager_t* am, uint32_ iter = am->first; while (iter != NULL) { + widget_animator_t* next = iter->next; + widget_animator_time_elapse(iter, delta_time); - iter = iter->next; + iter = next; } return RET_OK;