]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Deletion error removed.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 27 Jun 2007 09:45:39 +0000 (09:45 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 27 Jun 2007 09:45:39 +0000 (09:45 +0000)
git-svn-id: file:///svn/unbound/trunk@425 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/mesh.c
services/outside_network.c

index 079789134671f1239c9a289d4d4ddb256bfd6d5e..2f7ff4c8aeabebd62b9e568cd954467a52f99813 100644 (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.
index fa07f328570aa07c1d7ae8348a9dd7f42a1a3078..c643c63fd0b6411864191ea4d4604efca57577e0 100644 (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);
 }
 
index 7649657055ade386b904ec9d77cc0e8610af1ffd..1a1ba2c95c53f0294d5e7af9bd7f6bf51ff584f4 100644 (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;
 }