mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 06:58:49 +00:00
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>
This commit is contained in:
parent
5902e5bfdb
commit
07aadb82fb
1 changed files with 3 additions and 5 deletions
|
@ -900,6 +900,7 @@ static void
|
||||||
gst_vaapi_display_destroy (GstVaapiDisplay * display)
|
gst_vaapi_display_destroy (GstVaapiDisplay * display)
|
||||||
{
|
{
|
||||||
GstVaapiDisplayPrivate *const priv = GST_VAAPI_DISPLAY_GET_PRIVATE (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->decoders, g_ptr_array_unref);
|
||||||
g_clear_pointer (&priv->encoders, 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;
|
priv->display = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!priv->use_foreign_display) {
|
if (klass->close_display)
|
||||||
GstVaapiDisplayClass *klass = GST_VAAPI_DISPLAY_GET_CLASS (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->display_name, g_free);
|
||||||
g_clear_pointer (&priv->vendor_string, g_free);
|
g_clear_pointer (&priv->vendor_string, g_free);
|
||||||
|
|
Loading…
Reference in a new issue