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.
This commit is contained in:
Sebastian Dröge 2014-09-22 10:08:17 +03:00
parent d153b01280
commit 8d457a4d18

View file

@ -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;