Browse Source

init calls deinit

Former-commit-id: 8ef81a3eb0786a9d00f8b60037eb433609da1c05
Alec Jacobson 9 years ago
parent
commit
c3ea0bfa0b
2 changed files with 4 additions and 1 deletions
  1. 3 0
      include/igl/AABB.h
  2. 1 1
      include/igl/point_simplex_squared_distance.h

+ 3 - 0
include/igl/AABB.h

@@ -322,6 +322,7 @@ inline void igl::AABB<DerivedV,DIM>::init(
 {
   using namespace std;
   using namespace Eigen;
+  deinit();
   if(bb_mins.size() > 0)
   {
     assert(bb_mins.rows() == bb_maxs.rows() && "Serial tree arrays must match");
@@ -380,6 +381,7 @@ inline void igl::AABB<DerivedV,DIM>::init(
     const Eigen::MatrixXi & Ele)
 {
   using namespace Eigen;
+  // deinit will be immediately called...
   return init(V,Ele,MatrixXDIMS(),MatrixXDIMS(),VectorXi(),0);
 }
 
@@ -392,6 +394,7 @@ inline void igl::AABB<DerivedV,DIM>::init(
 {
   using namespace Eigen;
   using namespace std;
+  deinit();
   if(V.size() == 0 || Ele.size() == 0 || I.size() == 0)
   {
     return;

+ 1 - 1
include/igl/point_simplex_squared_distance.h

@@ -11,7 +11,7 @@
 #include <Eigen/Core>
 namespace igl
 {
-  // Determine squared distance from a point to linear simplex
+  // Determine squared distance from a point to linear simplex. 
   //
   // Inputs:
   //   p  d-long query point