diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2005-02-20 17:43:38 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2005-02-20 17:43:38 +0000 |
commit | 9b02a501cd6ef8bbf91964373e9edebf75b87dd5 (patch) | |
tree | 65a54195f7355e96afed4fcb40c2a09fc63e70f0 /epan/stats_tree.c | |
parent | b65e9739d29e6ccaba833986088f10d32405475d (diff) | |
download | wireshark-9b02a501cd6ef8bbf91964373e9edebf75b87dd5.tar.gz wireshark-9b02a501cd6ef8bbf91964373e9edebf75b87dd5.tar.bz2 wireshark-9b02a501cd6ef8bbf91964373e9edebf75b87dd5.zip |
Fixes few things during reinitialization with gtk2 (it doesn't crash anymore),
there are still problems at reinit (gtk2 node->pr warns about an iterator not been OK)
set up propperties of the given files
svn path=/trunk/; revision=13448
Diffstat (limited to 'epan/stats_tree.c')
-rw-r--r-- | epan/stats_tree.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/epan/stats_tree.c b/epan/stats_tree.c index 3efd11f29f..1d67a04b62 100644 --- a/epan/stats_tree.c +++ b/epan/stats_tree.c @@ -2,7 +2,7 @@ * API for a counter tree for ethereal * 2004, Luis E. G. Ontanon * - * $Id: $ + * $Id$ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -152,18 +152,28 @@ static void reset_stat_node(stat_node* node) { } /* reset the whole stats_tree */ -extern void reset_stats_tree(void *psp ) { - stats_tree *st=psp; - - if (st) { - reset_stat_node(&st->root); - } +extern void reset_stats_tree(void* p) { + stats_tree* st = p; + reset_stat_node(&st->root); if (st->reset_tree) { st->reset_tree(st); } } +extern void reinit_stats_tree(void* p) { + stats_tree* st = p; + stat_node* child; + + for (child = st->root.children; child; child = child->next) { + free_stat_node(child); + } + + if (st->init) { + st->init(st); + } +} + /* register a new stats_tree */ extern void register_stats_tree(guint8* abbr, guint8* name, |