mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
free subroutine array (fix mem leak)
This commit is contained in:
parent
98ef18909a
commit
11e3f733ba
1 changed files with 8 additions and 1 deletions
|
|
@ -1762,6 +1762,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo)
|
|||
mainP->Instructions = _mesa_realloc_instructions(mainP->Instructions,
|
||||
mainP->NumInstructions,
|
||||
total);
|
||||
mainP->NumInstructions = total;
|
||||
for (i = 0; i < emitInfo->NumSubroutines; i++) {
|
||||
struct gl_program *sub = emitInfo->Subroutines[i];
|
||||
_mesa_copy_instructions(mainP->Instructions + subroutineLoc[i],
|
||||
|
|
@ -1771,7 +1772,13 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo)
|
|||
sub->Parameters = NULL; /* prevent double-free */
|
||||
_mesa_delete_program(ctx, sub);
|
||||
}
|
||||
mainP->NumInstructions = total;
|
||||
|
||||
/* free subroutine list */
|
||||
if (emitInfo->Subroutines) {
|
||||
_mesa_free(emitInfo->Subroutines);
|
||||
emitInfo->Subroutines = NULL;
|
||||
}
|
||||
emitInfo->NumSubroutines = 0;
|
||||
|
||||
/* Examine CAL instructions.
|
||||
* At this point, the BranchTarget field of the CAL instructions is
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue