From b0b3de2be750966343fca96b7123340f8656f056 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sat, 2 Feb 2019 13:17:16 +0100 Subject: mesa: release references to image textures when a context is destroyed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a texture is still bound as an image and the context it was bound in is destroyed but not the texture, then the texture will still hold the resource and will not be freed when it is finally destroyed. Hence, release these references when the context is destroyed. This leak was triggered by virglrenderer: https://gitlab.freedesktop.org/virgl/virglrenderer/issues/86 Signed-off-by: Gert Wollny Reviewed-by: Marek Olšák --- src/mesa/main/shaderimage.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/main/shaderimage.h') diff --git a/src/mesa/main/shaderimage.h b/src/mesa/main/shaderimage.h index 6a9e3d67e92..daed27508a7 100644 --- a/src/mesa/main/shaderimage.h +++ b/src/mesa/main/shaderimage.h @@ -68,6 +68,9 @@ _mesa_default_image_unit(struct gl_context *ctx); void _mesa_init_image_units(struct gl_context *ctx); +void +_mesa_free_image_textures(struct gl_context *ctx); + /** * Return GL_TRUE if the state of the image unit passed as argument is valid * and access from the shader is allowed. Otherwise loads from this unit -- cgit v1.2.3