Deletion error removed.

git-svn-id: file:///svn/unbound/trunk@425 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-06-27 09:45:39 +00:00
parent ee94589556
commit 3d9ea4721a
3 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,6 @@
27 June 2007: Wouter
- delete of mesh does a postorder traverse of the tree.
26 June 2007: Wouter
- mesh is called by worker, and iterator uses it.
This removes the hierarchical code.

View file

@ -100,16 +100,21 @@ mesh_create(int num_modules, struct module_func_block** modfunc,
return mesh;
}
/** help mesh delete delete mesh states */
static void
mesh_delete_helper(rbnode_t* n, void* ATTR_UNUSED(arg))
{
struct mesh_state* mstate = (struct mesh_state*)n->key;
mesh_state_cleanup(mstate);
}
void
mesh_delete(struct mesh_area* mesh)
{
struct mesh_state* mstate;
if(!mesh)
return;
/* free all query states */
RBTREE_FOR(mstate, struct mesh_state*, &mesh->all) {
mesh_state_cleanup(mstate);
}
traverse_postorder(&mesh->all, &mesh_delete_helper, NULL);
free(mesh);
}

View file

@ -1211,7 +1211,6 @@ outnet_serviced_query(struct outside_network* outnet,
cb->cb_arg = callback_arg;
cb->next = sq->cblist;
sq->cblist = cb;
return sq;
}