[723/906] gstglwindow: close has to be called in the glthread.

Indeed 'glXMakeCurrent (window_x11->device, None, NULL);'
has to be called in the thread where the glcontext is actually
current.
Otherwise glXDestroyContext may crash.
This commit is contained in:
Julien Isorce 2013-07-01 14:43:14 +01:00 committed by Matthew Waters
parent 89a6d7ef5d
commit ba19813816

View file

@ -160,7 +160,6 @@ static void
gst_gl_window_finalize (GObject * object) gst_gl_window_finalize (GObject * object)
{ {
GstGLWindow *window = GST_GL_WINDOW (object); GstGLWindow *window = GST_GL_WINDOW (object);
GstGLWindowClass *window_class = GST_GL_WINDOW_GET_CLASS (window);
if (window) { if (window) {
gst_gl_window_set_resize_callback (window, NULL, NULL); gst_gl_window_set_resize_callback (window, NULL, NULL);
@ -181,10 +180,6 @@ gst_gl_window_finalize (GObject * object)
window->priv->gl_thread = NULL; window->priv->gl_thread = NULL;
} }
if (window_class->close) {
window_class->close (window);
}
g_mutex_clear (&window->priv->render_lock); g_mutex_clear (&window->priv->render_lock);
g_cond_clear (&window->priv->cond_destroy_context); g_cond_clear (&window->priv->cond_destroy_context);
@ -729,6 +724,10 @@ _gst_gl_window_thread_create_context (GstGLWindow * window)
window->priv->alive = FALSE; window->priv->alive = FALSE;
if (window_class->close) {
window_class->close (window);
}
g_cond_signal (&window->priv->cond_destroy_context); g_cond_signal (&window->priv->cond_destroy_context);
g_mutex_unlock (&window->priv->render_lock); g_mutex_unlock (&window->priv->render_lock);