mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2405>
This commit is contained in:
parent
bc6b68215f
commit
fdca97eca8
1 changed files with 4 additions and 1 deletions
|
@ -691,11 +691,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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue