shmsink: fix possible deadlock in _render()/ _allocator_free()

Drop object lock before unrefing memory, otherwise the object
lock might be taken again from the allocator and then things
deadlock.

https://bugzilla.gnome.org/show_bug.cgi?id=760551
This commit is contained in:
Matt Crane 2016-01-15 10:49:12 -05:00 committed by Tim-Philipp Müller
parent 3184175dae
commit eba01f84e5

View file

@ -715,8 +715,8 @@ gst_shm_sink_render (GstBaseSink * bsink, GstBuffer * buf)
while (self->wait_for_connection && !self->clients) { while (self->wait_for_connection && !self->clients) {
g_cond_wait (&self->cond, GST_OBJECT_GET_LOCK (self)); g_cond_wait (&self->cond, GST_OBJECT_GET_LOCK (self));
if (self->unlock) { if (self->unlock) {
gst_memory_unref (memory);
GST_OBJECT_UNLOCK (self); GST_OBJECT_UNLOCK (self);
gst_memory_unref (memory);
return GST_FLOW_FLUSHING; return GST_FLOW_FLUSHING;
} }
} }