vc4: Fix a memory leak in the simulator case.

We validate per draw call, and need to free the shader per draw call, too.
This commit is contained in:
Eric Anholt 2015-10-06 16:12:50 -07:00
parent 3861010213
commit 922e0680f9
1 changed files with 6 additions and 1 deletions

View File

@ -106,10 +106,15 @@ vc4_simulator_unpin_bos(struct vc4_exec_info *exec)
{
for (int i = 0; i < exec->bo_count; i++) {
struct drm_gem_cma_object *obj = exec->bo[i];
struct vc4_bo *bo = to_vc4_bo(&obj->base)->bo;
struct drm_vc4_bo *drm_bo = to_vc4_bo(&obj->base);
struct vc4_bo *bo = drm_bo->bo;
memcpy(bo->map, obj->vaddr, bo->size);
if (drm_bo->validated_shader) {
free(drm_bo->validated_shader->texture_samples);
free(drm_bo->validated_shader);
}
free(obj);
}