Commit ce1c7b97 authored by Matthew Waters's avatar Matthew Waters 🐨 Committed by Tim-Philipp Müller
Browse files

rtmp2src: workaround a GLib race when destroying a GMainContext/GSource

https://gitlab.gnome.org/GNOME/glib/-/issues/803

Basically, if destruction of a GSource and its associated GMainContext are
not synchronised, Then the GSource destruction can access freed
GMainContext resources and cause a crash.  This is not super common but
can happen.

Part-of: <!2416>
parent 33a3c4f7
......@@ -686,11 +686,14 @@ gst_rtmp2_src_create (GstBaseSrc * src, guint64 offset, guint size,
return GST_FLOW_OK;
out:
g_mutex_unlock (&self->lock);
if (timeout) {
g_source_destroy (timeout);
g_source_unref (timeout);
}
/* Keep the unlock after the destruction of the timeout source to workaround
* https://gitlab.gnome.org/GNOME/glib/-/issues/803
*/
g_mutex_unlock (&self->lock);
return ret;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment