summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author[email protected] <[email protected]>2010-05-21 23:55:38 +0000
committer[email protected] <[email protected]>2010-05-21 23:55:38 +0000
commitecea5d2b896862d9f8068003853cfdafa6464965 (patch)
treec914ea5a6f5a4d00142a9a737f9536e9aa0edd9c /src
parent0b02a2ebcae2f00bcfa0330a6d32859137ef7d85 (diff)
fix thread delete issue when module is not used.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@724 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src')
-rw-r--r--src/idle.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/idle.c b/src/idle.c
index c894e49e6c..4ff95e6050 100644
--- a/src/idle.c
+++ b/src/idle.c
@@ -66,7 +66,7 @@ static void rt_thread_idle_entry(void* parameter)
{
rt_base_t lock;
#ifdef RT_USING_MODULE
- rt_module_t module;
+ rt_module_t module = thread->module_parent;
#endif
struct rt_thread* thread = rt_list_entry(rt_thread_defunct.next, struct rt_thread, tlist);
@@ -81,12 +81,10 @@ static void rt_thread_idle_entry(void* parameter)
/* release thread's stack */
rt_free(thread->stack_addr);
-#ifdef RT_USING_MODULE
- module = thread->module_parent;
-
/* delete thread object */
rt_object_delete((rt_object_t)thread);
+#ifdef RT_USING_MODULE
if(module != RT_NULL)
{
/* if the thread is module's main thread */