From 8b8e4489448ee866efb1f42c206b99b3b35c3bb7 Mon Sep 17 00:00:00 2001 From: heyuanjie Date: Fri, 29 Jun 2018 16:16:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/lwp/lwp.c | 2 +- components/lwp/lwp_mem.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/components/lwp/lwp.c b/components/lwp/lwp.c index 7157f27250..acd290bc0f 100644 --- a/components/lwp/lwp.c +++ b/components/lwp/lwp.c @@ -34,7 +34,7 @@ #define DBG_ENABLE #define DBG_SECTION_NAME "[LWP]" #define DBG_COLOR -#define DBG_LEVEL DBG_LOG +#define DBG_LEVEL DBG_WARNING #include extern rt_thread_t rt_current_thread; diff --git a/components/lwp/lwp_mem.c b/components/lwp/lwp_mem.c index ca390e4f96..6092dc6ee5 100644 --- a/components/lwp/lwp_mem.c +++ b/components/lwp/lwp_mem.c @@ -28,7 +28,7 @@ #define DBG_ENABLE #define DBG_SECTION_NAME "[LWPMEM]" #define DBG_COLOR -#define DBG_LEVEL DBG_LOG +#define DBG_LEVEL DBG_WARNING #include // todo: remove repleat code @@ -117,13 +117,18 @@ void rt_lwp_mem_deinit(struct rt_lwp *lwp) RT_ASSERT(lwp != RT_NULL); - for (node = lwp->hlist.next; node != &(lwp->hlist); node = node->next) + node = lwp->hlist.next; + + while (node != &(lwp->hlist)) { struct rt_lwp_memheap *lwp_heap; + lwp_heap = rt_list_entry(node, struct rt_lwp_memheap, mlist); - RT_ASSERT(lwp_heap != RT_NULL); + /* update note before free page*/ + node = node->next; + rt_lwp_free_page(lwp, lwp_heap); } } -- GitLab