[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Oct 7 15:38:55 EDT 2009


changeset 8b4a315d07bc in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=8b4a315d07bc
summary: already a copy

changeset 99befa8a01a9 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=99befa8a01a9
summary: cleanup color leaking

diffstat:

 apps/las2las.c   |   2 +-
 apps/lascommon.c |  21 +++++++++++++--------
 2 files changed, 14 insertions(+), 9 deletions(-)

diffs (55 lines):

diff -r 70905879ae81 -r 99befa8a01a9 apps/las2las.c
--- a/apps/las2las.c	Wed Oct 07 14:30:01 2009 -0500
+++ b/apps/las2las.c	Wed Oct 07 14:36:16 2009 -0500
@@ -922,7 +922,7 @@
         exit(1);
     }
 
-    header = LASHeader_Copy(LASReader_GetHeader(reader));
+    header = LASReader_GetHeader(reader);
     if (!header) { 
         LASError_Print("Could not read header");
         exit(1);
diff -r 70905879ae81 -r 99befa8a01a9 apps/lascommon.c
--- a/apps/lascommon.c	Wed Oct 07 14:30:01 2009 -0500
+++ b/apps/lascommon.c	Wed Oct 07 14:36:16 2009 -0500
@@ -260,7 +260,7 @@
 
     long rgpsum = 0;
     long pbretsum = 0;
-    
+    LASColorH color = NULL;
     int i = 0;
 
     if (!summary) {LASError_Print("Point Summary does not exist!"); exit(1);}
@@ -330,18 +330,23 @@
                   LASPoint_GetPointSourceId(summary->pmin),
                   LASPoint_GetPointSourceId(summary->pmax)
                   );
+                  
+    color = LASPoint_GetColor(summary->pmin);
     fprintf(file, "  Minimum Color:\t %d %d %d\n",
-                  LASColor_GetRed(LASPoint_GetColor(summary->pmin)),
-                  LASColor_GetGreen(LASPoint_GetColor(summary->pmin)),
-                  LASColor_GetBlue(LASPoint_GetColor(summary->pmin))
+                  LASColor_GetRed(color),
+                  LASColor_GetGreen(color),
+                  LASColor_GetBlue(color)
         );
+    LASColor_Destroy(color);
 
+    color = LASPoint_GetColor(summary->pmax);
     fprintf(file, "  Maximum Color:\t %d %d %d\n",
-                  LASColor_GetRed(LASPoint_GetColor(summary->pmax)),
-                  LASColor_GetGreen(LASPoint_GetColor(summary->pmax)),
-                  LASColor_GetBlue(LASPoint_GetColor(summary->pmax))
+                  LASColor_GetRed(color),
+                  LASColor_GetGreen(color),
+                  LASColor_GetBlue(color)
         );
-
+    LASColor_Destroy(color);
+    
     fprintf(file, "\n  Number of Points by Return\n");
     fprintf(file, "---------------------------------------------------------\n");
 


More information about the Liblas-commits mailing list