mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-25 00:30:37 +02:00
gallium/osmesa: Fix leak of the ST manager/api on library unload.
Closes: #883 Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7886>
This commit is contained in:
parent
bc3142734e
commit
ddbad3f4ea
1 changed files with 17 additions and 0 deletions
|
|
@ -134,9 +134,26 @@ osmesa_st_get_param(struct st_manager *smapi, enum st_manager_param param)
|
|||
static struct st_manager *stmgr = NULL;
|
||||
static struct st_api *stapi = NULL;
|
||||
|
||||
static void
|
||||
destroy_st_manager(void)
|
||||
{
|
||||
if (stmgr) {
|
||||
if (stmgr->screen)
|
||||
stmgr->screen->destroy(stmgr->screen);
|
||||
FREE(stmgr);
|
||||
}
|
||||
|
||||
if (stapi && stapi->destroy) {
|
||||
stapi->destroy(stapi);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
create_st_manager(void)
|
||||
{
|
||||
if (atexit(destroy_st_manager) != 0)
|
||||
return;
|
||||
|
||||
stmgr = CALLOC_STRUCT(st_manager);
|
||||
if (stmgr) {
|
||||
stmgr->screen = osmesa_create_screen();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue