[Liblas-commits] r1238 - trunk/apps

liblas-commits at liblas.org liblas-commits at liblas.org
Sun Apr 19 23:03:52 EDT 2009


Author: hobu
Date: Sun Apr 19 23:03:52 2009
New Revision: 1238
URL: http://liblas.org/changeset/1238

Log:
make sure to delete the point and row after we're done with them

Modified:
   trunk/apps/ts2las.cpp

Modified: trunk/apps/ts2las.cpp
==============================================================================
--- trunk/apps/ts2las.cpp	(original)
+++ trunk/apps/ts2las.cpp	Sun Apr 19 23:03:52 2009
@@ -35,6 +35,7 @@
     {
         delete istrm;
         throw std::runtime_error("Reading stream was not able to be created");
+        exit(1);
     }
     return istrm;
 }
@@ -59,6 +60,7 @@
     {
         delete ostrm;
         throw std::runtime_error("Writing stream was not able to be created");
+        exit(1);
     }
     
     return ostrm;
@@ -123,12 +125,13 @@
 
 bool WritePoints(LASWriter* writer, std::istream* strm, ScanHdr* hdr) 
 {
+    ScanPnt* point = new ScanPnt;
+    ScanRow* row = new ScanRow;
     while (true)
     {
 
 ///std::cout << "We have header version" << std::endl;
-            ScanPnt* point = new ScanPnt;
-            ScanRow* row = new ScanRow;
+
             try
             {
                 // std::cout << "stream position is: " << strm->tellg() << std::endl;
@@ -228,6 +231,8 @@
             }   
 
     }
+    delete point;
+    delete row;
     return true;    
 
 }


More information about the Liblas-commits mailing list