socket based sources: close socket stream on unprepare

the socket was otherwise leaked
This commit is contained in:
Mathieu Duponchelle 2020-02-03 21:46:56 +01:00
parent 90cb42fdf9
commit 4abb389269
2 changed files with 4 additions and 0 deletions

View file

@ -626,6 +626,8 @@ impl TcpClientSrc {
self.src_pad.stop_task().await;
*self.src_pad_handler.0.socket_stream.lock().await = None;
{
let socket = state.socket.take().unwrap();
socket.unprepare().await.unwrap();

View file

@ -921,6 +921,8 @@ impl UdpSrc {
self.src_pad.stop_task().await;
*self.src_pad_handler.0.socket_stream.lock().await = None;
{
let socket = state.socket.take().unwrap();
socket.unprepare().await.unwrap();