[Liblas-commits] hg: 3 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Fri May 7 11:52:09 EDT 2010


changeset 24ec192cf95a in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=24ec192cf95a
summary: whitespace normalization

changeset d4fcfaa5e29f in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=d4fcfaa5e29f
summary: copy and own cached headers for reader/writers

changeset d6a9d0b414a4 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=d6a9d0b414a4
summary: free returned extra data

diffstat:

 python/liblas/file.py  |  6 +++---
 python/liblas/point.py |  2 +-
 src/las_c_api.cpp      |  2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diffs (54 lines):

diff -r 0887f823a17d -r d6a9d0b414a4 python/liblas/file.py
--- a/python/liblas/file.py	Fri May 07 10:09:02 2010 -0500
+++ b/python/liblas/file.py	Fri May 07 10:51:59 2010 -0500
@@ -113,7 +113,7 @@
             
             if self._header == None:
                 self.handle = core.las.LASReader_Create(self.filename)
-                self._header = lasheader.Header(handle = core.las.LASReader_GetHeader(self.handle))
+                self._header = lasheader.Header(handle = core.las.LASReader_GetHeader(self.handle), owned=True, copy=True)
             else:
                 self.handle = core.las.LASReader_CreateWithHeader(self.filename, self._header.handle)
 
@@ -128,7 +128,7 @@
         if self._mode == 'w' and '+' not in self._mode:
 
             if self._header == None:
-                self._header = lasheader.Header(handle = core.las.LASHeader_Create())
+                self._header = lasheader.Header(handle = core.las.LASHeader_Create(), owned=True, copy=True)
             self.handle = core.las.LASWriter_Create(self.filename, self._header.handle, 1)
             self.mode = 1
             files['write'].append(self.filename)
@@ -141,7 +141,7 @@
         if '+' in self._mode and 'r' not in self._mode:
             if self._header == None:
                 reader = core.las.LASReader_Create(self.filename)
-                self._header = lasheader.Header(handle = core.las.LASReader_GetHeader(reader))
+                self._header = lasheader.Header(handle = core.las.LASReader_GetHeader(reader), owned=True, copy=True)
                 core.las.LASReader_Destroy(reader)
             self.handle = core.las.LASWriter_Create(self.filename, self._header.handle, 2)
             self.mode = 2
diff -r 0887f823a17d -r d6a9d0b414a4 python/liblas/point.py
--- a/python/liblas/point.py	Fri May 07 10:09:02 2010 -0500
+++ b/python/liblas/point.py	Fri May 07 10:51:59 2010 -0500
@@ -423,7 +423,7 @@
         for i in range(l.contents.value):
             s[i] = d2.contents[i]
         p_d = ctypes.cast(d, ctypes.POINTER(ctypes.c_char_p))
-   #     core.las.LASString_Free(p_d)
+        core.las.LASString_Free(p_d)
 
         return s
 
diff -r 0887f823a17d -r d6a9d0b414a4 src/las_c_api.cpp
--- a/src/las_c_api.cpp	Fri May 07 10:09:02 2010 -0500
+++ b/src/las_c_api.cpp	Fri May 07 10:51:59 2010 -0500
@@ -749,7 +749,7 @@
     try {
         liblas::Point* p = ((liblas::Point*) hPoint);
         std::vector<liblas::uint8_t> d = p->GetExtraData();
-		*length = static_cast<liblas::uint16_t>(d.size());
+        *length = static_cast<liblas::uint16_t>(d.size());
         *data = (liblas::uint8_t*) malloc (*length * sizeof(liblas::uint8_t));
         for (liblas::uint16_t i=0; i < *length; i++) {
             (*data)[i] = d[i];


More information about the Liblas-commits mailing list