This commit is contained in:
heyuanjie 2018-06-29 16:16:27 +08:00
parent 7d3af8e9ff
commit 8b8e448944
2 changed files with 9 additions and 4 deletions

View File

@ -34,7 +34,7 @@
#define DBG_ENABLE #define DBG_ENABLE
#define DBG_SECTION_NAME "[LWP]" #define DBG_SECTION_NAME "[LWP]"
#define DBG_COLOR #define DBG_COLOR
#define DBG_LEVEL DBG_LOG #define DBG_LEVEL DBG_WARNING
#include <rtdbg.h> #include <rtdbg.h>
extern rt_thread_t rt_current_thread; extern rt_thread_t rt_current_thread;

View File

@ -28,7 +28,7 @@
#define DBG_ENABLE #define DBG_ENABLE
#define DBG_SECTION_NAME "[LWPMEM]" #define DBG_SECTION_NAME "[LWPMEM]"
#define DBG_COLOR #define DBG_COLOR
#define DBG_LEVEL DBG_LOG #define DBG_LEVEL DBG_WARNING
#include <rtdbg.h> #include <rtdbg.h>
// todo: remove repleat code // todo: remove repleat code
@ -117,13 +117,18 @@ void rt_lwp_mem_deinit(struct rt_lwp *lwp)
RT_ASSERT(lwp != RT_NULL); 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; struct rt_lwp_memheap *lwp_heap;
lwp_heap = rt_list_entry(node, struct rt_lwp_memheap, mlist);
lwp_heap = rt_list_entry(node, struct rt_lwp_memheap, mlist);
RT_ASSERT(lwp_heap != RT_NULL); RT_ASSERT(lwp_heap != RT_NULL);
/* update note before free page*/
node = node->next;
rt_lwp_free_page(lwp, lwp_heap); rt_lwp_free_page(lwp, lwp_heap);
} }
} }