提交 cb9bc38e 编写于 作者: Nameless-Y's avatar Nameless-Y

[components][serial]关闭uart时,反初始化tx_dma->data_queue,防止内存泄漏

上级 63750945
......@@ -785,6 +785,8 @@ static rt_err_t rt_serial_close(struct rt_device *dev)
tx_dma = (struct rt_serial_tx_dma*)serial->serial_tx;
RT_ASSERT(tx_dma != RT_NULL);
rt_data_queue_deinit(&(tx_dma->data_queue));
rt_free(tx_dma);
serial->serial_tx = RT_NULL;
dev->open_flag &= ~RT_DEVICE_FLAG_DMA_TX;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册