Request pads leaking if present when element disposed

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Request pads leaking if present when element disposed

Brendan Shanks
Hi, I'm writing an element that subclasses GstBin, and returns request ghost pads targeting elements inside the bin.
I noticed that GstGhostPads and GstProxyPads are leaking if they're present in the element when it gets disposed/finalized.

I'm unsure of the cause, but one thing I noticed is that the docs for gst_element_release_request_pad() say that the call needs to be followed by gst_object_unref().
But in gst_element_dispose(), the element's release_pad() is being called without gst_object_unref() afterwards.

Is this an oversight, or is the pad getting an unnecessary ref somewhere else?

Thanks,
Brendan

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Request pads leaking if present when element disposed

Thiago Sousa Santos-2


On Fri, Jan 20, 2017 at 10:59 PM, Brendan Shanks <[hidden email]> wrote:
Hi, I'm writing an element that subclasses GstBin, and returns request ghost pads targeting elements inside the bin.
I noticed that GstGhostPads and GstProxyPads are leaking if they're present in the element when it gets disposed/finalized.

I'm unsure of the cause, but one thing I noticed is that the docs for gst_element_release_request_pad() say that the call needs to be followed by gst_object_unref().
But in gst_element_dispose(), the element's release_pad() is being called without gst_object_unref() afterwards.

Is this an oversight, or is the pad getting an unnecessary ref somewhere else?

I'd say the second option. If you share the relevants parts of your code we might help tracking it down.

The element's release_pad() has different requirements than that of gst_element_release_request_pad(). Usually the element's release_pad will call gst_element_remove_pad() that unparents the pad, removing the parent's reference to it.
 

Thanks,
Brendan

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




--
Thiago Sousa Santos

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel