Hello.
Latest GIT from Terragear has 2 memory leaks in terrafit.cc and
Terra/greadyinsert.
Heap size increases from 0 to hero in under 2 minutes given enough files
are thrown at it. 
Patches attached. Notify upstream, close main shuttle bay doors.

--
Adrian


diff --git a/src/Prep/Terra/GreedyInsert.cc b/src/Prep/Terra/GreedyInsert.cc
index 2659bb1..3c60c9f 100644
--- a/src/Prep/Terra/GreedyInsert.cc
+++ b/src/Prep/Terra/GreedyInsert.cc
@@ -20,6 +20,10 @@ void TrackedTriangle::update(Subdivision& s)
 
 
 
+GreedySubdivision::~GreedySubdivision()
+{
+	delete heap;
+}
 
 GreedySubdivision::GreedySubdivision(Map *map)
 {
diff --git a/src/Prep/Terra/GreedyInsert.h b/src/Prep/Terra/GreedyInsert.h
index 3b4b816..23588be 100644
--- a/src/Prep/Terra/GreedyInsert.h
+++ b/src/Prep/Terra/GreedyInsert.h
@@ -68,7 +68,7 @@ protected:
 
 public:
     GreedySubdivision(Map *map);
-
+    ~GreedySubdivision();
     array2<char> is_used;
 
     Edge *select(int sx, int sy, Triangle *t=NULL);
diff --git a/src/Prep/TerraFit/terrafit.cc b/src/Prep/TerraFit/terrafit.cc
index 6a09bc7..b02f304 100644
--- a/src/Prep/TerraFit/terrafit.cc
+++ b/src/Prep/TerraFit/terrafit.cc
@@ -203,7 +203,8 @@ void fit_file(const std::string& path) {
                         gzprintf(fp,"%+03.8f %+02.8f %0.2f\n",vx,vy,vz);
                 }
         }
-        
+        delete mesh;
+        delete DEM;
         gzclose(fp);
 }
 
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to