From a0258e3e6ba233645a8e4e527844498ffe8e049b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 6 May 2020 16:13:11 +0300 Subject: [PATCH] gldisplay: Fix context leak when removing a context from the display Part-of: --- gst-libs/gst/gl/gstgldisplay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index ec9e45ebcf..8c9b136333 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -906,12 +906,13 @@ gst_gl_display_remove_context (GstGLDisplay * display, GstGLContext * needle) 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; if (context) { GST_INFO_OBJECT (display, "removed context %" GST_PTR_FORMAT " from internal list", context); + gst_object_unref (context); return; } + l = prev ? prev->next : display->priv->contexts; continue; } prev = l;