GNOME Bugzilla – Bug 647763
[bus] Bus is leaked if a watch is installed in the default main context
Last modified: 2011-04-18 10:04:32 UTC
When running the gio unit test in -base (pipelines/gio) the bus is leaked. This happens because the bus watch (the GSource) is never finalized (although the main loop is) and it holds a reference of the bus. I'm sure this didn't happen before, otherwise the leak in this test would have been noticed already.
the imagefreeze unit test in -good has the same leak... and many others too probably.
This should have happenend before, the source would always be reachable via the default main context and is never freed. Unfortunately my current valgrind version doesn't detect the source and the bus as reachable but as leak ;) We should probably change all unit tests to detach the source before calling exit, as was done in some tests already
...but the "leak" goes away when reverting to GstBus from 0.10.32. Needs some more debugging it seems
Created attachment 186154 [details] [review] diff Reverting only this part of the changes between 0.10.32 and 0.10.32.2 makes the "leak" go away... I don't see anything wrong here. Oh and it's not just because GstBus now stores a pointer to the default main context. Only storing a pointer to the default main context doesn't change anything.
And the bus source is not finalized with this patch either so it's just valgrind that for some reason believes that the bus is leaked now.
I'll just fix this in all tests now
Should be fixed in all tests now.