examples: gtksink: leaks tracer detects lots of leaks
To reproduce we need !775 (merged) and this extra change setting num-buffers
on the source so the app is terminated properly:
diff --git a/examples/src/bin/gtksink.rs b/examples/src/bin/gtksink.rs
index 9e07bf04..51e2b0fa 100644
--- a/examples/src/bin/gtksink.rs
+++ b/examples/src/bin/gtksink.rs
@@ -21,6 +21,7 @@ use std::cell::RefCell;
fn create_ui(app: >k::Application) {
let pipeline = gst::Pipeline::new(None);
let src = gst::ElementFactory::make("videotestsrc", None).unwrap();
+ src.set_property("num-buffers", &50).unwrap();
// Create the gtk sink and retrieve the widget from it. The sink element will be used
// in the pipeline, and the widget will be embedded in our gui.
// Gstreamer then displays frames in the gtk widget.
We can then see that a lot of elements, including the pipeline are leaked:
$ GST_TRACERS="leaks" GST_DEBUG="GST_TRACER:7" cargo run --bin gtksink --features=gtksink
(...)
0:00:01.948911781 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstVideoTestSrc, address=(gpointer)0x560c217409e0, description=(string)<videotestsrc0>, ref-count=(uint)1, trace=(string);
0:00:01.949149722 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstProxyPad, address=(gpointer)0x560c218fe0a0, description=(string)<sink:proxypad0>, ref-count=(uint)1, trace=(string);
0:00:01.949283225 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstProxyControlBinding, address=(gpointer)0x560c2163a660, description=(string)<GstProxyControlBinding@0x560c2163a660>, ref-count=(uint)1, trace=(string);
0:00:01.949302335 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstProxyControlBinding, address=(gpointer)0x560c21893050, description=(string)<GstProxyControlBinding@0x560c21893050>, ref-count=(uint)1, trace=(string);
0:00:01.949315073 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstProxyControlBinding, address=(gpointer)0x560c2163a580, description=(string)<GstProxyControlBinding@0x560c2163a580>, ref-count=(uint)1, trace=(string);
0:00:01.949327049 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstProxyControlBinding, address=(gpointer)0x560c2163a4a0, description=(string)<GstProxyControlBinding@0x560c2163a4a0>, ref-count=(uint)1, trace=(string);
0:00:01.949338849 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstPipeline, address=(gpointer)0x560c218ee130, description=(string)<pipeline0>, ref-count=(uint)1, trace=(string);
0:00:01.949351882 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstPad, address=(gpointer)0x560c218f1120, description=(string)<glcolorbalance0:src>, ref-count=(uint)1, trace=(string);
0:00:01.949364233 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstPad, address=(gpointer)0x560c218f0ed0, description=(string)<glcolorbalance0:sink>, ref-count=(uint)1, trace=(string);
0:00:01.949376437 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstPad, address=(gpointer)0x560c218f0c80, description=(string)<glcolorconvertelement0:src>, ref-count=(uint)1, trace=(string);
0:00:01.949388504 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstPad, address=(gpointer)0x560c218f0a30, description=(string)<glcolorconvertelement0:sink>, ref-count=(uint)1, trace=(string);
0:00:01.949400701 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstPad, address=(gpointer)0x560c218f07e0, description=(string)<gluploadelement0:src>, ref-count=(uint)1, trace=(string);
0:00:01.949412818 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstPad, address=(gpointer)0x560c218f0590, description=(string)<gluploadelement0:sink>, ref-count=(uint)1, trace=(string);
0:00:01.949424708 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstPad, address=(gpointer)0x560c218f0340, description=(string)<sink:sink>, ref-count=(uint)1, trace=(string);
0:00:01.949432232 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstPad, address=(gpointer)0x560c218f00f0, description=(string)<videotestsrc0:src>, ref-count=(uint)1, trace=(string);
0:00:01.949439322 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstMemory, address=(gpointer)0x7f709c024130, description=(string)0x7f709c024130, ref-count=(uint)1, trace=(string);
0:00:01.949452903 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstMemory, address=(gpointer)0x7f70a86890e0, description=(string)0x7f70a86890e0, ref-count=(uint)1, trace=(string);
0:00:01.949462968 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstMemory, address=(gpointer)0x7f70a87268e0, description=(string)0x7f70a87268e0, ref-count=(uint)1, trace=(string);
0:00:01.949475884 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstMemory, address=(gpointer)0x7f70a87bd160, description=(string)0x7f70a87bd160, ref-count=(uint)1, trace=(string);
0:00:01.949485635 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstMemory, address=(gpointer)0x7f709c026400, description=(string)0x7f709c026400, ref-count=(uint)1, trace=(string);
0:00:01.949497069 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstMemory, address=(gpointer)0x7f709c023120, description=(string)0x7f709c023120, ref-count=(uint)1, trace=(string);
0:00:01.949508411 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGtkGLSink, address=(gpointer)0x560c21823330, description=(string)<sink>, ref-count=(uint)2, trace=(string);
0:00:01.949520324 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGhostPad, address=(gpointer)0x560c218fc060, description=(string)<glsinkbin0:sink>, ref-count=(uint)1, trace=(string);
0:00:01.949533017 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLWrappedContext, address=(gpointer)0x560c218ec190, description=(string)<glwrappedcontext0>, ref-count=(uint)8, trace=(string);
0:00:01.949545903 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLWindowX11, address=(gpointer)0x560c218fa340, description=(string)<glwindowx11-0>, ref-count=(uint)1, trace=(string);
0:00:01.949558034 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLUploadElement, address=(gpointer)0x560c218f83a0, description=(string)<gluploadelement0>, ref-count=(uint)1, trace=(string);
0:00:01.949570056 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLSinkBin, address=(gpointer)0x560c21691020, description=(string)<glsinkbin0>, ref-count=(uint)1, trace=(string);
0:00:01.949582227 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLShader, address=(gpointer)0x560c218ecf30, description=(string)<glshader1>, ref-count=(uint)1, trace=(string);
0:00:01.949593763 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLShader, address=(gpointer)0x560c218ecbd0, description=(string)<glshader0>, ref-count=(uint)1, trace=(string);
0:00:01.949605998 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLSLStage, address=(gpointer)0x560c218eccf0, description=(string)<glslstage2>, ref-count=(uint)1, trace=(string);
0:00:01.949624540 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLSLStage, address=(gpointer)0x560c218ec3f0, description=(string)<glslstage0>, ref-count=(uint)1, trace=(string);
0:00:01.949636531 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLSLStage, address=(gpointer)0x560c218ece10, description=(string)<glslstage3>, ref-count=(uint)1, trace=(string);
0:00:01.949648649 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLSLStage, address=(gpointer)0x560c218ec510, description=(string)<glslstage1>, ref-count=(uint)1, trace=(string);
0:00:01.949661264 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLOverlayCompositor, address=(gpointer)0x560c2174ff20, description=(string)<gloverlaycompositor0>, ref-count=(uint)1, trace=(string);
0:00:01.949673893 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLDisplayX11, address=(gpointer)0x560c2190a050, description=(string)<gldisplayx11-0>, ref-count=(uint)8, trace=(string);
0:00:01.949686069 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLContextGLX, address=(gpointer)0x560c21c280a0, description=(string)<glcontextglx0>, ref-count=(uint)15, trace=(string);
0:00:01.949698356 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLColorConvertElement, address=(gpointer)0x560c218f8730, description=(string)<glcolorconvertelement0>, ref-count=(uint)1, trace=(string);
0:00:01.949712595 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLColorBalance, address=(gpointer)0x560c21819d00, description=(string)<glcolorbalance0>, ref-count=(uint)1, trace=(string);
0:00:01.949725695 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstGLBufferPool, address=(gpointer)0x560c21c28ac0, description=(string)<glbufferpool3>, ref-count=(uint)1, trace=(string);
0:00:01.949738029 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstContext, address=(gpointer)0x560c218e3760, description=(string)context 'gst.gl.app_context'='context, context=(GstGLContext)"\(GstGLWrappedContext\)\ glwrappedcontext0";', ref-count=(uint)1, trace=(string);
0:00:01.949750620 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstContext, address=(gpointer)0x560c218e39e0, description=(string)context 'gst.gl.app_context'='context, context=(GstGLContext)"\(GstGLWrappedContext\)\ glwrappedcontext0";', ref-count=(uint)1, trace=(string);
0:00:01.949763411 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstContext, address=(gpointer)0x560c218e35e0, description=(string)context 'gst.gl.GLDisplay'='context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";', ref-count=(uint)1, trace=(string);
0:00:01.949775471 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstContext, address=(gpointer)0x560c218e3860, description=(string)context 'gst.gl.GLDisplay'='context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";', ref-count=(uint)1, trace=(string);
0:00:01.949788662 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstContext, address=(gpointer)0x560c218e3640, description=(string)context 'gst.gl.app_context'='context, context=(GstGLContext)"\(GstGLWrappedContext\)\ glwrappedcontext0";', ref-count=(uint)1, trace=(string);
0:00:01.949802417 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstContext, address=(gpointer)0x560c218e34c0, description=(string)context 'gst.gl.GLDisplay'='context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";', ref-count=(uint)1, trace=(string);
0:00:01.949815116 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstContext, address=(gpointer)0x560c218e3700, description=(string)context 'gst.gl.GLDisplay'='context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";', ref-count=(uint)3, trace=(string);
0:00:01.949827850 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstCaps, address=(gpointer)0x560c218d1590, description=(string)video/x-raw(memory:GLMemory), format=(string)RGBA, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, texture-target=(string)2D, ref-count=(uint)4, trace=(string);
0:00:01.949842283 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstCaps, address=(gpointer)0x7f709c001f20, description=(string)video/x-raw, format=(string)RGBA, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, ref-count=(uint)2, trace=(string);
0:00:01.949856164 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0x560c216d1a00, description=(string)<bus0>, ref-count=(uint)3, trace=(string);
0:00:01.949868147 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0x560c216d1880, description=(string)<bus1>, ref-count=(uint)2, trace=(string);
0:00:01.949879570 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBus, address=(gpointer)0x560c213e65c0, description=(string)<bus2>, ref-count=(uint)5, trace=(string);
0:00:01.949892488 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x560c218ec7e0, description=(string)buffer: 0x560c218ec7e0, pts 0:00:01.633333333, dts 99:99:99.999999999, dur 0:00:00.033333333, size 307200, offset 49, offset_end 50, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:01.949906401 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x560c218eca20, description=(string)buffer: 0x560c218eca20, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 307200, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:01.949919219 379244 0x560c21502f90 TRACE GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x560c218ec900, description=(string)buffer: 0x560c218ec900, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 307200, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
** (gtksink:379244): WARNING **: 18:08:52.976: Leaks detected and logged under GST_DEBUG=GST_TRACER:7