mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
teflon: Release the arrays of tensors in operations
We were leaking the arrays themselves. Also reorder the dereferencing of the tensors to get the lifecycle right. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34627>
This commit is contained in:
parent
63251d43ae
commit
a99e5be446
1 changed files with 8 additions and 3 deletions
|
|
@ -369,9 +369,6 @@ partition_init(TfLiteContext *tf_context, const char *buffer, size_t length)
|
|||
operations,
|
||||
params->nodes_to_replace->size);
|
||||
|
||||
for (int i = 0; i < tf_context->tensors_size; i++)
|
||||
pipe_resource_reference(&tensors[i].resource, NULL);
|
||||
|
||||
struct teflon_subgraph *tsubgraph = calloc(1, sizeof(*tsubgraph));
|
||||
tsubgraph->base = subgraph;
|
||||
|
||||
|
|
@ -402,6 +399,14 @@ partition_init(TfLiteContext *tf_context, const char *buffer, size_t length)
|
|||
free(tensors[i].zero_points);
|
||||
}
|
||||
|
||||
for (int i = 0; i < params->nodes_to_replace->size; i++) {
|
||||
free(operations[i].input_tensors);
|
||||
free(operations[i].output_tensors);
|
||||
}
|
||||
|
||||
for (int i = 0; i < tf_context->tensors_size; i++)
|
||||
pipe_resource_reference(&tensors[i].resource, NULL);
|
||||
|
||||
return tsubgraph;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue