pad: Fix race between gst_element_remove_pad and state change
authorStian Selnes <stian@pexip.com>
Wed, 27 Jan 2016 10:46:06 +0000 (11:46 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 24 Mar 2016 12:39:47 +0000 (14:39 +0200)
commit7dd76b626e0dacdba2844243944ec6c14ddf6932
treeaaf4b9212f964fab0f13407fcd69191af3e0c9b5
parent9b0d42ceecb3198399d7e05e3d5f080a7ca27ca9
pad: Fix race between gst_element_remove_pad and state change

When going from READY to NULL all element pads are deactivated. If
simultaneously the pad is being removed from the element with
gst_element_remove_pad() and the pad is unparented, there is a race
where the deactivation will assert (g_critical) if the parent is lost at
the wrong time.

The proposed fix will check parent only once and retain it to avoid the
race.

https://bugzilla.gnome.org/show_bug.cgi?id=761912
gst/gstpad.c