summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-11-16 13:55:40 -0700
committerBrian Paul <brianp@vmware.com>2013-11-18 08:56:34 -0700
commit401f2d6ea8d8068747b6f507e8a8907ad9f6fe71 (patch)
treeaaf5421ba3677c2a94bd6750ccd66e75bf3cb084
parentd33d260b905401b8279c111b1350781bc08673f0 (diff)
postprocess: simplify pp_free() code
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--src/gallium/auxiliary/postprocess/pp_init.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/gallium/auxiliary/postprocess/pp_init.c b/src/gallium/auxiliary/postprocess/pp_init.c
index a49a23d11d4..bbebb5ce6e6 100644
--- a/src/gallium/auxiliary/postprocess/pp_init.c
+++ b/src/gallium/auxiliary/postprocess/pp_init.c
@@ -169,11 +169,12 @@ pp_free(struct pp_queue_t *ppq)
{
unsigned int i, j;
- if (ppq) {
- pp_free_fbos(ppq);
- }
+ if (!ppq)
+ return;
- if (ppq && ppq->p) {
+ pp_free_fbos(ppq);
+
+ if (ppq->p) {
if (ppq->p->pipe && ppq->filters && ppq->shaders) {
for (i = 0; i < ppq->n_filters; i++) {
unsigned int filter = ppq->filters[i];
@@ -221,17 +222,15 @@ pp_free(struct pp_queue_t *ppq)
FREE(ppq->p);
}
- if (ppq) {
- /*
- * Handle partial initialization for common resource destruction
- * in the create path.
- */
- FREE(ppq->filters);
- FREE(ppq->shaders);
- FREE(ppq->pp_queue);
+ /*
+ * Handle partial initialization for common resource destruction
+ * in the create path.
+ */
+ FREE(ppq->filters);
+ FREE(ppq->shaders);
+ FREE(ppq->pp_queue);
- FREE(ppq);
- }
+ FREE(ppq);
pp_debug("Queue taken down.\n");
}