Merge pull request #3516 from yangjie11/yj_dev
[components][serial]关闭uart时,反初始化tx_dma->data_queue,防止内存泄漏
This commit is contained in:
commit
446091fc10
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue