]> git.tue.mpg.de Git - paraslash.git/commitdiff
recv: Init and teardown btr node.
authorAndre Noll <maan@systemlinux.org>
Mon, 28 Dec 2009 21:09:34 +0000 (22:09 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 28 Dec 2009 21:09:34 +0000 (22:09 +0100)
buffer_tree.h
recv.c

index 18b9e8a29576ce7bd25dae68a2640add87bb14b0..8a7a33b8316c8aee5b6156cb4dd64f7749999d6e 100644 (file)
@@ -2,5 +2,6 @@
 struct btr_node;
 
 struct btr_node *btr_new_node(char *name, struct btr_node *parent);
+void btr_del_node(struct btr_node *btrn);
 void btr_add_output(char *buf, size_t size, struct btr_node *btrn);
 bool btr_is_leaf_node(struct btr_node *btrn);
diff --git a/recv.c b/recv.c
index d2af64418ec12a623dd78ca717cec2a832e3eb87..e04f6484981a9659fe399d9df4066c06ca6dab2b 100644 (file)
--- a/recv.c
+++ b/recv.c
@@ -92,6 +92,7 @@ int main(int argc, char *argv[])
        }
        r = &receivers[receiver_num];
        rn.receiver = r;
+       rn.btr_root = btr_new_node("receiver", NULL /* no parent */);
        ret = r->open(&rn);
        if (ret < 0)
                goto out;
@@ -110,8 +111,10 @@ int main(int argc, char *argv[])
 
        ret = schedule(&s);
 out:
-       if (r_opened)
+       if (r_opened) {
+               btr_del_node(rn.btr_root);
                r->close(&rn);
+       }
        if (r)
                r->shutdown();
        if (ret < 0)