From 8d457a4d18d858ab7a9a2c58d9c2c81d1d20b48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 22 Sep 2014 10:08:17 +0300 Subject: [PATCH] gl: Let gst_gl_context_get_thread() return a new reference to the GThread Otherwise it might go away in the meantime and the caller has some random pointer. --- gst-libs/gst/gl/gstglcontext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 9d59ff50bc..9a72f56f8b 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -422,7 +422,7 @@ gst_gl_context_activate (GstGLContext * context, gboolean activate) * gst_gl_context_get_thread: * @context: a #GstGLContext * - * Returns: The #GThread, @context is current in or NULL + * Returns: (transfer full): The #GThread, @context is current in or NULL * * Since: 1.6 */ @@ -433,6 +433,8 @@ gst_gl_context_get_thread (GstGLContext * context) GST_OBJECT_LOCK (context); ret = context->priv->active_thread; + if (ret) + g_thread_ref (ret); GST_OBJECT_UNLOCK (context); return ret;