diff --git a/src/memheap.c b/src/memheap.c index aef56e1a7425a52337511e8c94cbfc23d3916321..0ff6925696bc9c5f0645f6868579983afd2fabbd 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -126,8 +126,8 @@ rt_err_t rt_memheap_detach(struct rt_memheap *heap) RT_ASSERT(heap); RT_ASSERT(rt_object_get_type(&heap->parent) == RT_Object_Class_MemHeap); RT_ASSERT(rt_object_is_systemobject(&heap->parent)); - - rt_object_detach(&(heap->lock.parent.parent)); + + rt_sem_detach(&heap->lock); rt_object_detach(&(heap->parent)); /* Return a successful completion. */