summaryrefslogtreecommitdiff
path: root/experimental/tectonics/quadtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/tectonics/quadtree.c')
-rw-r--r--experimental/tectonics/quadtree.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/experimental/tectonics/quadtree.c b/experimental/tectonics/quadtree.c
index dead9f2..0f3f9c7 100644
--- a/experimental/tectonics/quadtree.c
+++ b/experimental/tectonics/quadtree.c
@@ -133,3 +133,16 @@ void draw_quadtree(cairo_t *cr, struct quadtree_node_t *node)
draw_quadtree(cr, node->se);
}
}
+
+
+void free_tree(struct quadtree_node_t *node)
+{
+ if (node->nw != NULL) {
+ free_tree(node->nw);
+ free_tree(node->ne);
+ free_tree(node->sw);
+ free_tree(node->se);
+ }
+
+ free(node);
+}