unref an element without memory leak

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

unref an element without memory leak

Liu Xin

hi, 


I'm writing a pipeline with dynamic branch. While removing the branch, I ran into the case in which a queue element will be gst_bin_removed in the probe callback to the queue's peering tee element. My question is, what if there's frame data still hanging in the queue element? Will this lead to a memory leak?


Please share your expertise.


Thanks,

Xin


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

Re: unref an element without memory leak

Nicolas Dufresne-5


Le 16 oct. 2017 3:09 PM, "Liu Xin" <[hidden email]> a écrit :

hi, 


I'm writing a pipeline with dynamic branch. While removing the branch, I ran into the case in which a queue element will be gst_bin_removed in the probe callback to the queue's peering tee element. My question is, what if there's frame data still hanging in the queue element? Will this lead to a memory leak?


It's a requirement to set the element to NULL state before you unref it. The buffers will be discarded and returned to their appropriate pool and/or allocator during this state transition.


Please share your expertise.


Thanks,

Xin


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



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

答复: unref an element without memory leak

Liu Xin

Thanks Nicolas



发件人: gstreamer-devel <[hidden email]> 代表 Nicolas Dufresne <[hidden email]>
发送时间: 2017年10月17日 5:40
收件人: Discussion of the development of and with GStreamer
主题: Re: unref an element without memory leak
 


Le 16 oct. 2017 3:09 PM, "Liu Xin" <[hidden email]> a écrit :

hi, 


I'm writing a pipeline with dynamic branch. While removing the branch, I ran into the case in which a queue element will be gst_bin_removed in the probe callback to the queue's peering tee element. My question is, what if there's frame data still hanging in the queue element? Will this lead to a memory leak?


It's a requirement to set the element to NULL state before you unref it. The buffers will be discarded and returned to their appropriate pool and/or allocator during this state transition.


Please share your expertise.


Thanks,

Xin


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



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