summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/src/workqueue.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/components/drivers/src/workqueue.c b/components/drivers/src/workqueue.c
index eb6cefc006..474eae556b 100644
--- a/components/drivers/src/workqueue.c
+++ b/components/drivers/src/workqueue.c
@@ -231,7 +231,9 @@ rt_err_t rt_workqueue_destroy(struct rt_workqueue *queue)
{
RT_ASSERT(queue != RT_NULL);
+ rt_workqueue_cancel_all_work();
rt_thread_delete(queue->work_thread);
+ rt_sem_detach(&(queue->sem));
RT_KERNEL_FREE(queue);
return RT_EOK;