[Liblas-devel] Python - memory leak problem

Stanley Wong s.wong at kucerainternational.com
Mon Feb 13 12:48:59 EST 2012


Hi, 


I am having a memory leak problem with the following function in Python: 



def changeScaleOfLidarPoints(lasPointList): 
for p in lasPointList: 
(tmpx,tmpy,tmpz) = (p.x,p.y,p.z) 
h = p.header 
h.scale = [0.001,0.001,0.001] 
p.header = h 
p.x = tmpx 
p.y = tmpy 
p.z = tmpz 

del h 
del p 
del lasPointList 


I am trying to use this function to change an existing list of points from a default scale of 0.01 to 0.001 and keeping the coordinate values. 
The memory leak probably has to do with the circular reference of the header, but that is the only way I can get the scale to change for the points. 


Can someone please help me solve the memory leak or offer a workaround? 


Thanks, 


Stanley 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/liblas-devel/attachments/20120213/133fd002/attachment.html


More information about the Liblas-devel mailing list