diff options
Diffstat (limited to 'libdimension/csg.c')
-rw-r--r-- | libdimension/csg.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libdimension/csg.c b/libdimension/csg.c index caecee0..0222b8b 100644 --- a/libdimension/csg.c +++ b/libdimension/csg.c @@ -92,9 +92,11 @@ dmnsn_new_csg_union(const dmnsn_array *objects) dmnsn_object *csg = dmnsn_new_object(); DMNSN_ARRAY_FOREACH (dmnsn_object **, object, objects) { + DMNSN_INCREF(*object); dmnsn_array_push(csg->children, object); } + csg->ptr = NULL; csg->intersection_fn = dmnsn_csg_union_intersection_fn; csg->inside_fn = dmnsn_csg_union_inside_fn; csg->initialize_fn = dmnsn_csg_union_initialize_fn; @@ -234,6 +236,8 @@ dmnsn_new_csg_intersection(dmnsn_object *A, dmnsn_object *B) { dmnsn_object *csg = dmnsn_new_object(); + DMNSN_INCREF(A); + DMNSN_INCREF(B); dmnsn_object **params = dmnsn_malloc(2*sizeof(dmnsn_object *)); params[0] = A; params[1] = B; @@ -292,6 +296,8 @@ dmnsn_new_csg_difference(dmnsn_object *A, dmnsn_object *B) { dmnsn_object *csg = dmnsn_new_object(); + DMNSN_INCREF(A); + DMNSN_INCREF(B); dmnsn_object **params = dmnsn_malloc(2*sizeof(dmnsn_object *)); params[0] = A; params[1] = B; @@ -353,6 +359,8 @@ dmnsn_new_csg_merge(dmnsn_object *A, dmnsn_object *B) { dmnsn_object *csg = dmnsn_new_object(); + DMNSN_INCREF(A); + DMNSN_INCREF(B); dmnsn_object **params = dmnsn_malloc(2*sizeof(dmnsn_object *)); params[0] = A; params[1] = B; |