mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +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/6504>
This commit is contained in:
parent
3c5bb4bf5d
commit
d9b563e9b2
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