mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-03-28 19:07:44 +08:00
Merge pull request #3516 from yangjie11/yj_dev
[components][serial]关闭uart时,反初始化tx_dma->data_queue,防止内存泄漏
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user