From 07aadb82fba079d0a3250607d9a41f9a43a84798 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Thu, 11 Jun 2020 08:25:57 +0200 Subject: [PATCH] libs: display: always call close_display() All close_display() have their own checks for use_foreign_display and only destroy locally created objects in that case. Without this objects other than the actuall foreign display itself are leaked. Part-of: --- gst-libs/gst/vaapi/gstvaapidisplay.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index 4391441..5e8a135 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -900,6 +900,7 @@ static void gst_vaapi_display_destroy (GstVaapiDisplay * display) { GstVaapiDisplayPrivate *const priv = GST_VAAPI_DISPLAY_GET_PRIVATE (display); + GstVaapiDisplayClass *klass = GST_VAAPI_DISPLAY_GET_CLASS (display); g_clear_pointer (&priv->decoders, g_ptr_array_unref); g_clear_pointer (&priv->encoders, g_ptr_array_unref); @@ -914,11 +915,8 @@ gst_vaapi_display_destroy (GstVaapiDisplay * display) priv->display = NULL; } - if (!priv->use_foreign_display) { - GstVaapiDisplayClass *klass = GST_VAAPI_DISPLAY_GET_CLASS (display); - if (klass->close_display) - klass->close_display (display); - } + if (klass->close_display) + klass->close_display (display); g_clear_pointer (&priv->display_name, g_free); g_clear_pointer (&priv->vendor_string, g_free); -- 2.7.4