mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-08 09:04:17 +00:00
rtpmux: release pads when disposing
Because of an allocated priv (GstRTPMuxPadPrivate), the element will leak memory if not gst_rtp_mux_release_pad() is called. This would previously only happen if release_request_pad() was called explicitly, somthing that should not be neccesary. Fixes #604099
This commit is contained in:
parent
0d54122804
commit
eab65e84ca
1 changed files with 19 additions and 1 deletions
|
@ -97,7 +97,7 @@ static void gst_rtp_mux_set_property (GObject * object, guint prop_id,
|
|||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_rtp_mux_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
|
||||
static void gst_rtp_mux_dispose (GObject * object);
|
||||
|
||||
GST_BOILERPLATE (GstRTPMux, gst_rtp_mux, GstElement, GST_TYPE_ELEMENT);
|
||||
|
||||
|
@ -125,6 +125,7 @@ gst_rtp_mux_class_init (GstRTPMuxClass * klass)
|
|||
|
||||
gobject_class->get_property = gst_rtp_mux_get_property;
|
||||
gobject_class->set_property = gst_rtp_mux_set_property;
|
||||
gobject_class->dispose = gst_rtp_mux_dispose;
|
||||
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
||||
PROP_TIMESTAMP_OFFSET, g_param_spec_int ("timestamp-offset",
|
||||
|
@ -152,6 +153,23 @@ gst_rtp_mux_class_init (GstRTPMuxClass * klass)
|
|||
klass->chain_func = gst_rtp_mux_chain;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_rtp_mux_dispose (GObject * object)
|
||||
{
|
||||
GList *item;
|
||||
|
||||
restart:
|
||||
for (item = GST_ELEMENT_PADS (object); item; item = g_list_next (item)) {
|
||||
GstPad *pad = GST_PAD (item->data);
|
||||
if (GST_PAD_IS_SINK (pad)) {
|
||||
gst_element_release_request_pad (GST_ELEMENT (object), pad);
|
||||
goto restart;
|
||||
}
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_rtp_mux_src_event (GstPad * pad, GstEvent * event)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue