diff options
| author | Bernard Xiong <[email protected]> | 2018-01-25 17:46:59 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2018-01-25 17:46:59 +0800 |
| commit | 1f37c1a497db234a6cfd8a8ef945491a6d2b9b09 (patch) | |
| tree | 6d58ba7c8250ffd97ab84c28c61441561056d8e2 /src/object.c | |
| parent | e38e996e5b62e54b8db95e464a1c40e436a689e9 (diff) | |
[Kernel] Fix the object find issue when enable MODULE
Diffstat (limited to 'src/object.c')
| -rw-r--r-- | src/object.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/object.c b/src/object.c index 9225a2bc73..14d5f1cf3b 100644 --- a/src/object.c +++ b/src/object.c @@ -26,6 +26,7 @@ * 2007-01-28 Bernard rename RT_OBJECT_Class_Static to RT_Object_Class_Static * 2010-10-26 yi.qiu add module support in rt_object_allocate and rt_object_free * 2017-12-10 Bernard Add object_info enum. + * 2018-01-25 Bernard Fix the object find issue when enable MODULE. */ #include <rtthread.h> @@ -254,7 +255,7 @@ void rt_object_init(struct rt_object *object, #ifdef RT_USING_MODULE /* get module object information */ information = (rt_module_self() != RT_NULL) ? - &rt_module_self()->module_object[type] : &rt_object_container[type]; + &rt_module_self()->module_object[type] : rt_object_get_information(type); #else /* get object information */ information = rt_object_get_information(type); @@ -329,7 +330,7 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name) * module object should be managed by kernel object container */ information = (rt_module_self() != RT_NULL && (type != RT_Object_Class_Module)) ? - &rt_module_self()->module_object[type] : &rt_object_container[type]; + &rt_module_self()->module_object[type] : rt_object_get_information(type); #else /* get object information */ information = rt_object_get_information(type); |
