From bbc71ed90f43ca7b69e9209dbee1583bf8b07149 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Mon, 1 Jul 2013 14:43:14 +0100 Subject: [PATCH] [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. --- gst-libs/gst/gl/gstglwindow.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/gl/gstglwindow.c b/gst-libs/gst/gl/gstglwindow.c index 9a250d0abc..2cb74bd468 100644 --- a/gst-libs/gst/gl/gstglwindow.c +++ b/gst-libs/gst/gl/gstglwindow.c @@ -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);