diff options
| author | [email protected] <[email protected]> | 2012-03-18 03:53:54 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-03-18 03:53:54 +0000 |
| commit | b36c286036fab2f4673543bcd47df4dc8033073d (patch) | |
| tree | 954b8d0822d3c17ab453c6cb4c54ef06eb08eca4 | |
| parent | 4421ec8c64c564296bd2074d64017b271aec5f05 (diff) | |
fix module unload issue
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2000 bbd45198-f89e-11dd-88c7-29a3b14d5316
| -rw-r--r-- | src/module.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/module.c b/src/module.c index 00d0bebd4f..390497d69d 100644 --- a/src/module.c +++ b/src/module.c @@ -911,7 +911,7 @@ rt_err_t rt_module_unload(rt_module_t module) rt_kprintf("rt_module_unload: %s\n", module->parent.name); /* module has entry point */ - if ((module->parent.flag & RT_MODULE_FLAG_WITHOUTENTRY) != RT_MODULE_FLAG_WITHOUTENTRY) + if (!(module->parent.flag & RT_MODULE_FLAG_WITHOUTENTRY)) { /* suspend module main thread */ if (module->module_thread != RT_NULL) @@ -1109,7 +1109,10 @@ rt_err_t rt_module_unload(rt_module_t module) } #endif - rt_free(module->page_array); +#ifdef RT_USING_SLAB + if(module->page_array != RT_NULL) + rt_free(module->page_array); +#endif /* delete module object */ rt_object_delete((rt_object_t)module); |
