diff options
author | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2011-01-04 01:14:00 +0100 |
---|---|---|
committer | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2011-01-04 16:14:46 +0100 |
commit | 6de94e1012498b6859d9796f2836a162bb0ca4bc (patch) | |
tree | ad57341116996f0f4d83364c4f1e268a6c346014 /src/gallium/drivers/nvc0/nvc0_fence.c | |
parent | 471025929c893d223668814ad0f8e2bee76aac63 (diff) |
nvc0: delete memory caches and fence on screen destruction
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_fence.c')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_fence.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_fence.c b/src/gallium/drivers/nvc0/nvc0_fence.c index 0387c5940b..7c214ca9a7 100644 --- a/src/gallium/drivers/nvc0/nvc0_fence.c +++ b/src/gallium/drivers/nvc0/nvc0_fence.c @@ -73,6 +73,9 @@ nvc0_fence_emit(struct nvc0_fence *fence) fence->state = NVC0_FENCE_STATE_EMITTED; } +static void +nvc0_fence_trigger_release_buffers(struct nvc0_fence *fence); + void nvc0_fence_del(struct nvc0_fence *fence) { @@ -91,6 +94,13 @@ nvc0_fence_del(struct nvc0_fence *fence) screen->fence.tail = it; } } + + if (fence->buffers) { + debug_printf("WARNING: deleting fence with buffers " + "still hooked to it !\n"); + nvc0_fence_trigger_release_buffers(fence); + } + FREE(fence); } @@ -104,6 +114,7 @@ nvc0_fence_trigger_release_buffers(struct nvc0_fence *fence) nvc0_mm_free(alloc); alloc = next; }; + fence->buffers = NULL; } static void |