From 99cf9108340c2ccf7c1b05ec6f951e2e91b9c76c Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sat, 1 Aug 2020 03:13:55 +0200 Subject: [PATCH] mesa/st: Actually free the driver part of memory objects on destruction. _mesa_delete_memory_object(ctx, obj) == free(obj) but doesn't free the part of the gallium driver. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1206 Fixes: 49f4ecc6777 "mesa/st: start adding memory object support" Reviewed-by: Timothy Arceri Part-of: --- src/mesa/state_tracker/st_cb_memoryobjects.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mesa/state_tracker/st_cb_memoryobjects.c b/src/mesa/state_tracker/st_cb_memoryobjects.c index b193eb37cb2..3ef316a45f8 100644 --- a/src/mesa/state_tracker/st_cb_memoryobjects.c +++ b/src/mesa/state_tracker/st_cb_memoryobjects.c @@ -54,6 +54,12 @@ static void st_memoryobj_free(struct gl_context *ctx, struct gl_memory_object *obj) { + struct st_memory_object *st_obj = st_memory_object(obj); + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + struct pipe_screen *screen = pipe->screen; + + screen->memobj_destroy(screen, st_obj->memory); _mesa_delete_memory_object(ctx, obj); } -- 2.30.2