diff options
author | Gert Wollny <[email protected]> | 2019-02-02 13:17:16 +0100 |
---|---|---|
committer | Gert Wollny <[email protected]> | 2019-02-05 10:53:41 +0000 |
commit | b0b3de2be750966343fca96b7123340f8656f056 (patch) | |
tree | 36507c22af4d85973ff32f612cf0037900248402 /src/mesa/main/context.c | |
parent | f1f3640f6fe841942a7de6a74f7a5c9996077e6b (diff) |
mesa: release references to image textures when a context is destroyed
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 <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 492f01de957..e5a89d9c2fc 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -129,6 +129,7 @@ #include "util/disk_cache.h" #include "util/strtod.h" #include "stencil.h" +#include "shaderimage.h" #include "texcompress_s3tc.h" #include "texstate.h" #include "transformfeedback.h" @@ -1345,6 +1346,7 @@ _mesa_free_context_data( struct gl_context *ctx ) _mesa_free_buffer_objects(ctx); _mesa_free_eval_data( ctx ); _mesa_free_texture_data( ctx ); + _mesa_free_image_textures(ctx); _mesa_free_matrix_data( ctx ); _mesa_free_pipeline_data(ctx); _mesa_free_program_data(ctx); |