Dispose() not finalize Pipeline
I tested simple program
Application.Init(ref args);
var pipeline = Parse.Launch("fakesink");
pipeline.Dispose();
with GST_DEBUG="GST_REFCOUNTING:6" environment to see does finalizers really executed
I found out that finalizers are executed only if I added pipeline.Unref() before pipeline.Dispose()
log example:
GST_REFCOUNTING gstelement.c:3328:gst_element_finalize:<fakesink0> 0x557375e8b300 finalize*
I need to do the same with all other objects that I take with bin.GetByName(), element.GetStaticPad() or other calls to finalize them and dispose them in native gstreamer
I found out this when I worked with webrtcbin, which had internal thread that only stopped when webrtcbin finalize was called. This usually leads to memory leakage. Also application did not stop correctly because it had active threads.
Is that the correct procedure to free resources? Samples do not call Unref() or Dispose()
I tried nuget package and locally builded version, both had the same behavior.