GMainContext: unref pending sources on destroy
authorRyan Lortie <desrt@desrt.ca>
Fri, 25 Oct 2013 05:47:37 +0000 (01:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 19 Jan 2014 22:41:18 +0000 (17:41 -0500)
commit8f6be404cbfbda7e188bd164bb72465eeaba6980
tree40b7d8630b003e8a36be296e7207a23029a5966a
parent2a3ee7ceafad19ecc2bfe435a95226f74d64952f
GMainContext: unref pending sources on destroy

It is possible (but unlikely) that there will be a non-empty list of
pending dispatches when we remove the last ref from a GMainContext.
Make sure we drop the refs on the sources appropriately.

Add a (now-working) testcase that demonstrates how to trigger the issue.

https://bugzilla.gnome.org/show_bug.cgi?id=139699
glib/gmain.c
glib/tests/mainloop.c