mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
vl/dri3: fix a memory leak from front buffer
Inspired by fix for mem leak of vdpau interop, resource_from_handle
set texture reference count, that need to be decreased and released,
recall there is a similar case for DRI3, that is with VA-API glx
extension, there is temporary TFP(texture from pixmap), we target it
through dma-buf. leak happens when without count down the reference.
Checked and found with mpv vo=opengl case, there only one static TFP,
the leak happens once, but for totem player using gstreamer VA-API glx,
the dynamic TFP for each frame, so leak quite a bit.
This fixes mem leak for mpv and totem.
Signed-off-by: Leo Liu <leo.liu@amd.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 134d6e4e4f)
This commit is contained in:
parent
b1b601fc7c
commit
aeb3ca9754
1 changed files with 1 additions and 0 deletions
|
|
@ -89,6 +89,7 @@ dri3_free_front_buffer(struct vl_dri3_screen *scrn,
|
|||
{
|
||||
xcb_sync_destroy_fence(scrn->conn, buffer->sync_fence);
|
||||
xshmfence_unmap_shm(buffer->shm_fence);
|
||||
pipe_resource_reference(&buffer->texture, NULL);
|
||||
FREE(buffer);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue