mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 15:08:48 +00:00
glimagesink: unref the potential last ref outside of the glimagesink lock
Avoids a deadlock between the state change removing the last ref and the destructer calling the window's on_close handler and trying to take the glimagesink lock. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6524>
This commit is contained in:
parent
e5b4f09172
commit
0bf962dbdf
1 changed files with 8 additions and 3 deletions
|
@ -1004,12 +1004,17 @@ gst_glimage_sink_mouse_scroll_event_cb (GstGLWindow * window,
|
|||
static void
|
||||
_set_context (GstGLImageSink * gl_sink, GstGLContext * context)
|
||||
{
|
||||
GST_GLIMAGE_SINK_LOCK (gl_sink);
|
||||
if (gl_sink->context)
|
||||
gst_object_unref (gl_sink->context);
|
||||
GstGLContext *old_context;
|
||||
|
||||
GST_GLIMAGE_SINK_LOCK (gl_sink);
|
||||
|
||||
old_context = gl_sink->context;
|
||||
gl_sink->context = context;
|
||||
|
||||
GST_GLIMAGE_SINK_UNLOCK (gl_sink);
|
||||
|
||||
if (old_context)
|
||||
gst_object_unref (old_context);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue