From c5ed45237ea2edeb7f861920c85e846f5e4f2277 Mon Sep 17 00:00:00 2001 From: liang yongxiang Date: Sat, 7 Jul 2018 13:59:36 +0800 Subject: [PATCH] [kernel] reset type when object delete or detach --- src/object.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/object.c b/src/object.c index 958161e320..e279d8b1d4 100644 --- a/src/object.c +++ b/src/object.c @@ -291,6 +291,9 @@ void rt_object_detach(rt_object_t object) RT_OBJECT_HOOK_CALL(rt_object_detach_hook, (object)); + /* reset object type */ + object->type = 0; + /* lock interrupt */ 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)); + /* reset object type */ + object->type = 0; + /* lock interrupt */ temp = rt_hw_interrupt_disable();