From 4abb389269270acb9609f5c0f335d11516514ff5 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Mon, 3 Feb 2020 21:46:56 +0100 Subject: [PATCH] socket based sources: close socket stream on unprepare the socket was otherwise leaked --- gst-plugin-threadshare/src/tcpclientsrc.rs | 2 ++ gst-plugin-threadshare/src/udpsrc.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/gst-plugin-threadshare/src/tcpclientsrc.rs b/gst-plugin-threadshare/src/tcpclientsrc.rs index 81f00c6f..286c20bf 100644 --- a/gst-plugin-threadshare/src/tcpclientsrc.rs +++ b/gst-plugin-threadshare/src/tcpclientsrc.rs @@ -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(); diff --git a/gst-plugin-threadshare/src/udpsrc.rs b/gst-plugin-threadshare/src/udpsrc.rs index 1872fd51..f64cea0d 100644 --- a/gst-plugin-threadshare/src/udpsrc.rs +++ b/gst-plugin-threadshare/src/udpsrc.rs @@ -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();