mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
mesa/st: release debug_output after destroying the context
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3230
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2218
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5789>
(cherry picked from commit 25baceafd3)
This commit is contained in:
parent
94047baebe
commit
d0634a167c
2 changed files with 9 additions and 2 deletions
|
|
@ -20002,7 +20002,7 @@
|
|||
"description": "mesa/st: release debug_output after destroying the context",
|
||||
"nominated": false,
|
||||
"nomination_type": null,
|
||||
"resolution": 4,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "main/accum.h"
|
||||
#include "main/api_exec.h"
|
||||
#include "main/context.h"
|
||||
#include "main/debug_output.h"
|
||||
#include "main/glthread.h"
|
||||
#include "main/samplerobj.h"
|
||||
#include "main/shaderobj.h"
|
||||
|
|
@ -1108,13 +1109,19 @@ st_destroy_context(struct st_context *st)
|
|||
|
||||
st_destroy_program_variants(st);
|
||||
|
||||
_mesa_free_context_data(ctx, true);
|
||||
/* Do not release debug_output yet because it might be in use by other threads.
|
||||
* These threads will be terminated by _mesa_free_context_data and
|
||||
* st_destroy_context_priv.
|
||||
*/
|
||||
_mesa_free_context_data(ctx, false);
|
||||
|
||||
/* This will free the st_context too, so 'st' must not be accessed
|
||||
* afterwards. */
|
||||
st_destroy_context_priv(st, true);
|
||||
st = NULL;
|
||||
|
||||
_mesa_destroy_debug_output(ctx);
|
||||
|
||||
free(ctx);
|
||||
|
||||
if (save_ctx == ctx) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue