From d240423d7422b51e10942fab00a2a34ed4c32e6f Mon Sep 17 00:00:00 2001 From: qiuyiuestc Date: Wed, 17 Nov 2010 16:17:07 +0000 Subject: construct module symbol table git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1053 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/idle.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/idle.c') diff --git a/src/idle.c b/src/idle.c index 82ed7cec49..2c0d9e0ba8 100644 --- a/src/idle.c +++ b/src/idle.c @@ -129,13 +129,15 @@ void rt_thread_idle_excute(void) if((module->module_thread == RT_NULL) && rt_list_isempty(&module->module_object[RT_Object_Class_Thread].object_list) ) { - /* unload module */ - rt_module_unload(module); + module->nref--; } } -#endif //RT_USING_MODULE + + /* unload module */ + if(module->nref == 0) rt_module_unload(module); +#endif } -#endif //RT_USING_HEAP +#endif } static void rt_thread_idle_entry(void* parameter) -- cgit v1.3.1