[kernel] reset type when object delete or detach

This commit is contained in:
liang yongxiang 2018-07-07 13:59:36 +08:00
parent f94cae3680
commit c5ed45237e
1 changed files with 6 additions and 0 deletions

View File

@ -291,6 +291,9 @@ void rt_object_detach(rt_object_t object)
RT_OBJECT_HOOK_CALL(rt_object_detach_hook, (object)); RT_OBJECT_HOOK_CALL(rt_object_detach_hook, (object));
/* reset object type */
object->type = 0;
/* lock interrupt */ /* lock interrupt */
temp = rt_hw_interrupt_disable(); temp = rt_hw_interrupt_disable();
@ -378,6 +381,9 @@ void rt_object_delete(rt_object_t object)
RT_OBJECT_HOOK_CALL(rt_object_detach_hook, (object)); RT_OBJECT_HOOK_CALL(rt_object_detach_hook, (object));
/* reset object type */
object->type = 0;
/* lock interrupt */ /* lock interrupt */
temp = rt_hw_interrupt_disable(); temp = rt_hw_interrupt_disable();