Gstelement refcount not descreasing to zero lead fd leak
We have requirement of dynamic pipeline where we add webrtc peer on request
and remove once the task done.
We are facing an issue when removing peer from the pipeline.
When we remove the elemtn object, element's refcount not become zero which
leads to not call of finalize & dispose function of child element ( created
when i set state webrtcbin to PLAYING) and hence we observe fd leaks of ICE
below is the code snippest of removal function.
1. Unlinking src & sink pad of elements which are created when we add peer
2. Make states of element to NULL
3. Remove elements from Pipeline.
4. Unref the objects
Even after following above steps, we see refcount of elements not becomes
Also if i set stated of pipeline ( which is dynamic pipeline, in which i
add webrtcbin element) to NULL in removal function then all finalize &
dispose functions are called & no fd leak. but i dont want to do that.
Can anyone help me in this case ?
For code reference, our code is based on below examples of webrtc,