mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-09 19:09:41 +00:00
libs: window: wayland: null buffer at destroy()
Fix leakage of the last wl buffer. VAAPI wayland sink needs to send a null buffer while destruction, it assures that all the wl buffers are released. Otherwise, the last buffer's callback might be not called, which leads to leak of GstVaapiDisplay. This was inspired by gstwaylandsink. https://bugzilla.gnome.org/show_bug.cgi?id=774029 Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
This commit is contained in:
parent
896a836f1d
commit
ca314a25cc
1 changed files with 9 additions and 0 deletions
|
@ -319,6 +319,15 @@ gst_vaapi_window_wayland_destroy (GstVaapiWindow * window)
|
|||
/* Wait for the last frame to complete redraw */
|
||||
gst_vaapi_window_wayland_sync (window);
|
||||
|
||||
/* Make sure that the last wl buffer's callback could be called */
|
||||
GST_VAAPI_OBJECT_LOCK_DISPLAY (window);
|
||||
if (priv->surface) {
|
||||
wl_surface_attach (priv->surface, NULL, 0, 0);
|
||||
wl_surface_commit (priv->surface);
|
||||
wl_display_flush (wl_display);
|
||||
}
|
||||
GST_VAAPI_OBJECT_UNLOCK_DISPLAY (window);
|
||||
|
||||
if (priv->event_queue)
|
||||
wl_display_roundtrip_queue (wl_display, priv->event_queue);
|
||||
|
||||
|
|
Loading…
Reference in a new issue