diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-06-11 08:25:57 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-07-31 11:14:43 +0200 |
commit | 07aadb82fba079d0a3250607d9a41f9a43a84798 (patch) | |
tree | 486bdd3a0c365f6a7ae9d22975f872f43caef25d | |
parent | 5902e5bfdbd800948962b19a229e7d1af258761f (diff) |
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/342>
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidisplay.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index 43914410..5e8a135d 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); |