GNOME Bugzilla – Bug 765903
fix various leaks in tests
Last modified: 2016-05-03 10:51:43 UTC
I kept feeding unit tests to my experimental leaks detection tool and fixed a bunch of leaks while doing so. :)
Created attachment 327146 [details] [review] elementfactory: fix factory leak in test
Created attachment 327147 [details] [review] fakesink: fix pipeline leak in test
Created attachment 327148 [details] [review] filesrc: fix buffer leaks in tests gst_check_setup_sink_pad() internally uses gst_check_chain_func() so we should call gst_check_drop_buffers() when tearing down tests to free the buffers which have been exchanged through the pipeline.
Created attachment 327149 [details] [review] selector: fix pad leaks in tests setup_input_pad() creates a new pad so we should unref it once we're done.
Created attachment 327150 [details] [review] streamiddemux: fix list and event leaks in test
Created attachment 327151 [details] [review] pipeline: fix bus leak in seek test gst_bus_add_signal_watch_full() keeps a ref on the bus which should be released using gst_bus_remove_signal_watch().
(In reply to Guillaume Desmottes from comment #0) > I kept feeding unit tests to my experimental leaks detection tool and fixed > a bunch of leaks while doing so. :) Where can your tool be found? :)
Attachment 327146 [details] pushed as 1e297d7 - elementfactory: fix factory leak in test Attachment 327147 [details] pushed as 1064bdb - fakesink: fix pipeline leak in test Attachment 327148 [details] pushed as 7c1a091 - filesrc: fix buffer leaks in tests Attachment 327149 [details] pushed as d456f8e - selector: fix pad leaks in tests Attachment 327150 [details] pushed as 0e42f92 - streamiddemux: fix list and event leaks in test Attachment 327151 [details] pushed as 8af52df - pipeline: fix bus leak in seek test
(In reply to Sebastian Dröge (slomo) from comment #7) > (In reply to Guillaume Desmottes from comment #0) > > I kept feeding unit tests to my experimental leaks detection tool and fixed > > a bunch of leaks while doing so. :) > > Where can your tool be found? :) "Coming soon" ;)
Any idea why valgrind couldn't catch those?
we make it ignore stuff that's still reachable (e.g. in global variables).