mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
bus: Unreferencing messages outside the lock
Shouldn't take the lock while unreferencing messages, because that may cause more messages to be sent, which will try to take the lock and cause the app to hang. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728777
This commit is contained in:
parent
6ec3c4bc66
commit
721539dc4f
1 changed files with 8 additions and 1 deletions
|
@ -446,6 +446,7 @@ void
|
|||
gst_bus_set_flushing (GstBus * bus, gboolean flushing)
|
||||
{
|
||||
GstMessage *message;
|
||||
GList *l, *message_list = NULL;
|
||||
|
||||
GST_OBJECT_LOCK (bus);
|
||||
|
||||
|
@ -455,13 +456,19 @@ gst_bus_set_flushing (GstBus * bus, gboolean flushing)
|
|||
GST_DEBUG_OBJECT (bus, "set bus flushing");
|
||||
|
||||
while ((message = gst_bus_pop (bus)))
|
||||
gst_message_unref (message);
|
||||
message_list = g_list_prepend (message_list, message);
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (bus, "unset bus flushing");
|
||||
GST_OBJECT_FLAG_UNSET (bus, GST_BUS_FLUSHING);
|
||||
}
|
||||
|
||||
GST_OBJECT_UNLOCK (bus);
|
||||
|
||||
for (l = message_list; l; l = l->next) {
|
||||
message = GST_MESSAGE (l);
|
||||
gst_message_unref (message);
|
||||
}
|
||||
g_list_free (message_list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue