diff options
author | Marek Olšák <[email protected]> | 2019-01-08 11:12:05 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-01-09 11:08:44 -0500 |
commit | e986c1ca1d61bd7492936f43e45996cd4f8bdb61 (patch) | |
tree | 4b18c8901de891ce4b4238dd7f9fe123c52d0226 /src/mesa | |
parent | fd82a1d1d6be1a3636ca5d8d952ae29fa260abc8 (diff) |
st/mesa: don't leak pipe_surface if pipe_context is not current
We have found some pipe_surface leaks internally.
This is the same code as surface_destroy in radeonsi.
Ideally, surface_destroy would be in pipe_screen.
Cc: 18.3 <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 8901a8680ef..8d099f7b0f9 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -285,8 +285,11 @@ st_renderbuffer_delete(struct gl_context *ctx, struct gl_renderbuffer *rb) struct st_context *st = st_context(ctx); pipe_surface_release(st->pipe, &strb->surface_srgb); pipe_surface_release(st->pipe, &strb->surface_linear); - strb->surface = NULL; + } else { + pipe_surface_release_no_context(&strb->surface_srgb); + pipe_surface_release_no_context(&strb->surface_linear); } + strb->surface = NULL; pipe_resource_reference(&strb->texture, NULL); free(strb->data); _mesa_delete_renderbuffer(ctx, rb); |