mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 01:02:19 +00:00
glcontext: fix race joining thread on finalize
https://bugzilla.gnome.org/show_bug.cgi?id=769939
This commit is contained in:
parent
117f81dc00
commit
2776cef25d
1 changed files with 8 additions and 1 deletions
|
@ -642,7 +642,14 @@ gst_gl_context_finalize (GObject * object)
|
||||||
gst_gl_window_quit (context->window);
|
gst_gl_window_quit (context->window);
|
||||||
|
|
||||||
GST_INFO_OBJECT (context, "joining gl thread");
|
GST_INFO_OBJECT (context, "joining gl thread");
|
||||||
g_thread_join (context->priv->gl_thread);
|
g_mutex_lock (&context->priv->render_lock);
|
||||||
|
if (context->priv->alive) {
|
||||||
|
GThread *t = context->priv->gl_thread;
|
||||||
|
g_mutex_unlock (&context->priv->render_lock);
|
||||||
|
g_thread_join (t);
|
||||||
|
} else {
|
||||||
|
g_mutex_unlock (&context->priv->render_lock);
|
||||||
|
}
|
||||||
GST_INFO_OBJECT (context, "gl thread joined");
|
GST_INFO_OBJECT (context, "gl thread joined");
|
||||||
context->priv->gl_thread = NULL;
|
context->priv->gl_thread = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue