summaryrefslogtreecommitdiff
path: root/src/idle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/idle.c')
-rw-r--r--src/idle.c10
1 files changed, 6 insertions, 4 deletions
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)