streamcollection: fix racy user-after-free
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 31 Mar 2017 09:38:15 +0000 (10:38 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 31 Mar 2017 10:32:31 +0000 (11:32 +0100)
commitefbacf1931d2f407e7f1c9f8f7dce994504a1188
tree309be801b14ced93435a0fec2ed493ada6d5f54e
parentd8a1bf08b1f94fcb25029bef8b6a6a93693245b7
streamcollection: fix racy user-after-free

The issue happens when the structure is printed by the logging
subsystem: the object is included in the log, and this will cause the
full object printout to be done there. However, after dispose, the queue
was already cleared, so the access to it (to print the object) would
assert, as the queue was already freed. The patch changes it so that the
queue is merely empty, and only freed in _finalize.

https://bugzilla.gnome.org/show_bug.cgi?id=776293
gst/gststreamcollection.c