From 7cbac97b947707837f935044f0f774a2414ff53a Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 22 Sep 2016 18:19:36 +1000 Subject: [PATCH] gldisplay: also free the GWeakRef when removing dead contexts Otherwise we leak GWeakRef's. Found with make -C tests/check libs/gstglcontext.valgrind --- gst-libs/gst/gl/gstgldisplay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index 7cb6266874..3ffc90666a 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -433,6 +433,7 @@ _get_gl_context_for_thread_unlocked (GstGLDisplay * display, GThread * thread) if (!context) { /* remove dead contexts */ g_weak_ref_clear (l->data); + g_free (l->data); display->priv->contexts = g_list_delete_link (display->priv->contexts, l); l = prev ? prev->next : display->priv->contexts; continue;