postprocess: simplify pp_free() code

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Brian Paul 2013-11-16 13:55:40 -07:00
parent d33d260b90
commit 401f2d6ea8
1 changed files with 13 additions and 14 deletions

View File

@ -169,11 +169,12 @@ pp_free(struct pp_queue_t *ppq)
{ {
unsigned int i, j; unsigned int i, j;
if (ppq) { if (!ppq)
pp_free_fbos(ppq); return;
}
if (ppq && ppq->p) { pp_free_fbos(ppq);
if (ppq->p) {
if (ppq->p->pipe && ppq->filters && ppq->shaders) { if (ppq->p->pipe && ppq->filters && ppq->shaders) {
for (i = 0; i < ppq->n_filters; i++) { for (i = 0; i < ppq->n_filters; i++) {
unsigned int filter = ppq->filters[i]; unsigned int filter = ppq->filters[i];
@ -221,7 +222,6 @@ pp_free(struct pp_queue_t *ppq)
FREE(ppq->p); FREE(ppq->p);
} }
if (ppq) {
/* /*
* Handle partial initialization for common resource destruction * Handle partial initialization for common resource destruction
* in the create path. * in the create path.
@ -231,7 +231,6 @@ pp_free(struct pp_queue_t *ppq)
FREE(ppq->pp_queue); FREE(ppq->pp_queue);
FREE(ppq); FREE(ppq);
}
pp_debug("Queue taken down.\n"); pp_debug("Queue taken down.\n");
} }