mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 16:28:08 +02:00
mesa: fix InfoLog memleak, misc sync with master
This commit is contained in:
parent
23db6287d4
commit
887bfee6e3
1 changed files with 8 additions and 4 deletions
|
|
@ -126,10 +126,17 @@ _mesa_free_shader_program_data(GLcontext *ctx,
|
|||
for (i = 0; i < shProg->NumShaders; i++) {
|
||||
_mesa_reference_shader(ctx, &shProg->Shaders[i], NULL);
|
||||
}
|
||||
shProg->NumShaders = 0;
|
||||
|
||||
if (shProg->Shaders) {
|
||||
_mesa_free(shProg->Shaders);
|
||||
shProg->Shaders = NULL;
|
||||
}
|
||||
|
||||
if (shProg->InfoLog) {
|
||||
_mesa_free(shProg->InfoLog);
|
||||
shProg->InfoLog = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -140,10 +147,7 @@ void
|
|||
_mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg)
|
||||
{
|
||||
_mesa_free_shader_program_data(ctx, shProg);
|
||||
if (shProg->Shaders) {
|
||||
_mesa_free(shProg->Shaders);
|
||||
shProg->Shaders = NULL;
|
||||
}
|
||||
|
||||
_mesa_free(shProg);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue