[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 Tim-Philipp Müller
parent 9af1cee2f7
commit bbc71ed90f

View file

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