From 0d6679a8036a45c03d0c5872a4cf6e9c6f87618f Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 28 Dec 2009 22:09:34 +0100 Subject: [PATCH] recv: Init and teardown btr node. --- buffer_tree.h | 1 + recv.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/buffer_tree.h b/buffer_tree.h index 18b9e8a2..8a7a33b8 100644 --- a/buffer_tree.h +++ b/buffer_tree.h @@ -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 d2af6441..e04f6484 100644 --- 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) -- 2.39.5