radeonsi: clear the debug callback on ctx destroy

The debug callback depends on the context to operate properly,
so we need to clear it on destroy to avoid a use-after-free.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12035
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32959>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2025-01-07 18:51:17 +01:00 committed by Marge Bot
parent 71cb394b02
commit 59a3f38ff6

View file

@ -194,6 +194,8 @@ static void si_destroy_context(struct pipe_context *context)
{
struct si_context *sctx = (struct si_context *)context;
context->set_debug_callback(context, NULL);
util_unreference_framebuffer_state(&sctx->framebuffer.state);
si_release_all_descriptors(sctx);