summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-09-22 18:19:36 +1000
committerMatthew Waters <matthew@centricular.com>2016-09-22 18:25:37 +1000
commitbad58e2b13ab8ad524396472586457950791f2d3 (patch)
treef04377bf670b22301432d3a22feb9172ce14196d
parentc40845731ab49c3e2aa304828007251031543bea (diff)
gldisplay: also free the GWeakRef when removing dead contexts
Otherwise we leak GWeakRef's. Found with make -C tests/check libs/gstglcontext.valgrind
-rw-r--r--gst-libs/gst/gl/gstgldisplay.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c
index 7cb626687..3ffc90666 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;