gldisplay: also free the GWeakRef when removing dead contexts

Otherwise we leak GWeakRef's.

Found with make -C tests/check libs/gstglcontext.valgrind
This commit is contained in:
Matthew Waters 2016-09-22 18:19:36 +10:00 committed by Tim-Philipp Müller
parent cb0f02c78a
commit 7cbac97b94

View file

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