From 597e9e6c14686bdd3899fd915b33f4b9dd3c93b3 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 5 Aug 2013 19:17:13 +0200 Subject: [PATCH] Finish porting TriangleMesh->translate --- xs/src/admesh/shared.c | 8 ++++++-- xs/xsp/TriangleMesh.xsp | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/xs/src/admesh/shared.c b/xs/src/admesh/shared.c index 62a1d95cd..59fbbb219 100644 --- a/xs/src/admesh/shared.c +++ b/xs/src/admesh/shared.c @@ -26,10 +26,14 @@ void stl_invalidate_shared_vertices(stl_file *stl) { - if (stl->v_indices != NULL) + if (stl->v_indices != NULL) { free(stl->v_indices); - if (stl->v_shared != NULL) + stl->v_indices = NULL; + } + if (stl->v_shared != NULL) { free(stl->v_shared); + stl->v_shared = NULL; + } } void diff --git a/xs/xsp/TriangleMesh.xsp b/xs/xsp/TriangleMesh.xsp index 58fc9bb99..7f47df61d 100644 --- a/xs/xsp/TriangleMesh.xsp +++ b/xs/xsp/TriangleMesh.xsp @@ -37,7 +37,7 @@ TriangleMesh::stats() SV* TriangleMesh::vertices() CODE: - if (THIS->stl.stats.shared_vertices == 0) + if (THIS->stl.v_shared == NULL) stl_generate_shared_vertices(&(THIS->stl)); // vertices @@ -59,7 +59,7 @@ TriangleMesh::vertices() SV* TriangleMesh::facets() CODE: - if (THIS->stl.stats.shared_vertices == 0) + if (THIS->stl.v_shared == NULL) stl_generate_shared_vertices(&(THIS->stl)); // facets