summaryrefslogtreecommitdiff
path: root/shape.c
diff options
context:
space:
mode:
Diffstat (limited to 'shape.c')
-rw-r--r--shape.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/shape.c b/shape.c
index 16eb5b50f4..ab32533a9d 100644
--- a/shape.c
+++ b/shape.c
@@ -1432,6 +1432,21 @@ Init_default_shapes(void)
}
void
+rb_shape_free_all(void)
+{
+ rb_shape_t *cursor = rb_shape_get_root_shape();
+ rb_shape_t *end = rb_shape_get_shape_by_id(GET_SHAPE_TREE()->next_shape_id);
+ while (cursor < end) {
+ if (cursor->edges && !SINGLE_CHILD_P(cursor->edges)) {
+ rb_id_table_free(cursor->edges);
+ }
+ cursor++;
+ }
+
+ xfree(GET_SHAPE_TREE());
+}
+
+void
Init_shape(void)
{
#if SHAPE_DEBUG