Memory leak when accessing stats structure
It seems that this short snippet of code creates a leak of approx 300 bytes per loop itteration. If creating a pipeline with a jitterbuffer element and accessing the stats property on that element instead the leak is about 600 bytes per itteration.
Using gstreamer-sharp 1.17.0.1 and gstreamer 1.18.1. Also tested gstreamer-sharp 1.18.0, but that makes no difference.
Skipped pasting initialization and setting up Glib main loop for simplicity below.
`
private void Setup()
{
_pipeline = new Pipeline("Stats test 2");
Element src = ElementFactory.Make("videotestsrc", "videotestsrc");
Element sourcequeue = ElementFactory.Make("queue", "sourcequeue");
Element sink = ElementFactory.Make("d3d11videosink", "d3d11videosink");
_pipeline.Add(src, sourcequeue, sink);
src.Link(sourcequeue);
sourcequeue.Link(sink);
StateChangeReturn ret = _pipeline.SetState(State.Playing);
statstest = sink;
}
private void CreateLeak()
{
for (int i = 0; i < 10000; i++)
{
Structure structure = (Structure)statstest.GetProperty("stats");
if (structure != null)
{
//structure.GetUint64("dropped", out ulong droppedatrenderer);
//structure.GetUint64("rendered", out ulong rendered);
}
structure?.Dispose();
}
}
`