X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=filter.c;h=07b78aed59e5d2a04c400003d2136cd2e956a1c4;hp=8ef9ac1afa2db2860d12eec33c68f18581fbeb11;hb=9c00a79ed817c854ed10ee6bd1b908df8dc13a2f;hpb=85094cd802bdb606d4e2bf7ed66dec51db2a0953 diff --git a/filter.c b/filter.c index 8ef9ac1a..07b78aed 100644 --- a/filter.c +++ b/filter.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2011 Andre Noll + * Copyright (C) 2005-2013 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -140,7 +140,13 @@ int main(int argc, char *argv[]) EMBRACE(.name = f->name, .parent = parent, .handler = f->execute, .context = fn)); fn->task.pre_select = f->pre_select; - fn->task.post_select = f->post_select; + if (f->new_post_select) { + fn->task.new_post_select = f->new_post_select; + fn->task.post_select = NULL; + } else { + fn->task.new_post_select = NULL; + fn->task.post_select = f->post_select; + } f->open(fn); register_task(&s, &fn->task); parent = fn->btrn; @@ -161,13 +167,14 @@ out_cleanup: f = filters + fn->filter_num; if (f->close) f->close(fn); - btr_free_node(fn->btrn); - free(fn->conf); + btr_remove_node(&fn->btrn); + if (f->free_config) + f->free_config(fn->conf); free(fn); } free(fns); - btr_free_node(sit->btrn); - btr_free_node(sot->btrn); + btr_remove_node(&sit->btrn); + btr_remove_node(&sot->btrn); out: if (ret < 0) PARA_EMERG_LOG("%s\n", para_strerror(-ret));