From f7c86584640321553b9226f9bb19c345391e72de Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 24 Sep 2013 14:07:58 +1000 Subject: [PATCH] [816/906] x11: fix make check segfault --- gst-libs/gst/gl/x11/gstglwindow_x11.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.c b/gst-libs/gst/gl/x11/gstglwindow_x11.c index 844cf521c1..d3659a486f 100644 --- a/gst-libs/gst/gl/x11/gstglwindow_x11.c +++ b/gst-libs/gst/gl/x11/gstglwindow_x11.c @@ -620,8 +620,6 @@ gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11) gboolean ret = TRUE; window = GST_GL_WINDOW (window_x11); - context = gst_gl_window_get_context (window); - context_class = GST_GL_CONTEXT_GET_CLASS (context); if (g_main_loop_is_running (window_x11->loop) && XPending (window_x11->device)) { @@ -669,8 +667,13 @@ gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11) case Expose: if (window->draw) { + context = gst_gl_window_get_context (window); + context_class = GST_GL_CONTEXT_GET_CLASS (context); + window->draw (window->draw_data); context_class->swap_buffers (context); + + gst_object_unref (context); } break; @@ -705,8 +708,6 @@ gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11) } // switch } // while running - gst_object_unref (context); - return ret; }