From 4866e4c452d28794c216a1730f923dfa9eac8616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Tue, 10 Oct 2017 19:57:45 +0200 Subject: [PATCH] plugins: fix memory leak when GL context is created When the GL display and context are created inside an VAAPI element the created GL context is leaked. https://bugzilla.gnome.org/show_bug.cgi?id=773453 --- gst/vaapi/gstvaapipluginbase.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 6194c3057b..1f81ac102a 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -1240,6 +1240,8 @@ gst_vaapi_plugin_base_create_gl_context (GstVaapiPluginBase * plugin) } while (!gst_gl_display_add_context (gl_display, gl_context)); GST_OBJECT_UNLOCK (gl_display); + gst_object_replace (&plugin->gl_context, (GstObject *) gl_context); + return GST_OBJECT_CAST (gl_context); /* ERRORS */