Index: molecuilder/src/boundary.cpp
===================================================================
--- molecuilder/src/boundary.cpp	(revision ab7b5e790fe67536a487cf68eca39490d9fe0624)
+++ molecuilder/src/boundary.cpp	(revision 43850620c713470f256e9ec9a6a59f5dc50d979d)
@@ -249,4 +249,5 @@
 CandidateForTesselation::~CandidateForTesselation() {
 	point = NULL;
+	BaseLine = NULL;
 }
 
@@ -1912,5 +1913,5 @@
   int N[NDIM], Nlower[NDIM], Nupper[NDIM];
   atom *Candidate = NULL;
-  CandidateForTesselation *optCandidate;
+  CandidateForTesselation *optCandidate = NULL;
 
   cout << Verbose(1) << "Begin of Find_third_point_for_Tesselation" << endl;
@@ -2021,4 +2022,10 @@
                             << alpha << " and circumsphere's center at " << optCandidate->OptCenter << "." << endl;
                         } else {
+                          // remove all candidates from the list and then the list itself
+                          class CandidateForTesselation *remover = NULL;
+                          for (CandidateList::iterator it = candidates->begin(); it != candidates->end(); ++it) {
+                            remover = *it;
+                            delete(remover);
+                          }
                           candidates->clear();
                           candidates->push_back(optCandidate);
@@ -2408,11 +2415,10 @@
   );
   cout << Verbose(1) << "Third Points are ";
-  CandidateList::iterator it;
-  for (it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
+  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
       cout << " " << *(*it)->point;
   }
   cout << endl;
 
-  for (it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
+  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
 	  // add third triangle point
 	  AddTrianglePoint((*it)->point, 2);
@@ -2440,4 +2446,11 @@
 	  }
   }
+  // remove all candidates from the list and then the list itself
+  class CandidateForTesselation *remover = NULL;
+  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
+    remover = *it;
+    delete(remover);
+  }
+  delete(Opt_Candidates);
   cout << Verbose(2) << "Projection is " << BTS->NormalVector.Projection(&Oben) << "." << endl;
   cout << Verbose(1) << "End of Find_starting_triangle\n";
@@ -2572,6 +2585,5 @@
   }
   cout << Verbose(1) << "Third Points are ";
-  CandidateList::iterator it;
-  for (it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
+  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
 	  cout << " " << *(*it)->point;
   }
@@ -2579,5 +2591,5 @@
 
   BoundaryLineSet *BaseRay = &Line;
-  for (it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
+  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
 	  cout << Verbose(1) << " Third point candidate is " << *(*it)->point
 		<< " with circumsphere's center at " << (*it)->OptCenter << "." << endl;
@@ -2701,13 +2713,13 @@
     // set baseline to new ray from ref point (here endpoints[0]->node) to current candidate (here (*it)->point))
 	  BaseRay = BLS[0];
-//    LineMap::iterator LineIterator = Line.endpoints[0]->lines.find((*it)->point->nr);
-//    for (; LineIterator != Line.endpoints[0]->lines.end(); LineIterator++) {
-//      if ((*LineIterator->second).TrianglesCount != 2)
-//        break;
-//    }
-//    if (LineIterator == Line.endpoints[0]->lines.end())
-//      cout << Verbose(1) << "ERROR: I could not find a suitable line with less than two triangles connected!" << endl;
-  }
-
+  }
+
+  // remove all candidates from the list and then the list itself
+  class CandidateForTesselation *remover = NULL;
+  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
+    remover = *it;
+    delete(remover);
+  }
+  delete(Opt_Candidates);
   cout << Verbose(1) << "End of Find_next_suitable_triangle\n";
   return result;
