[gdal-dev] Re: Memory leaks in Geo::OGR::Geometry Points() swig Perl function

Ari Jolma ari.jolma at gmail.com
Wed Mar 14 15:47:21 EDT 2012


On 03/14/2012 01:34 PM, Ari Jolma wrote:
> On 03/14/2012 12:59 PM, Ivan Balashov wrote:
>> I appologize that it is memory leak within Points() function.
>

After some research I conclude that in several cases the returned value 
was not made "mortal", i.e., the Perl variables could not be garbage 
collected. This was especially the case in methods which returned 
arrays, like GetPoint_2D, which is called from within Points.

I've commited a change to trunk that should fix the problem (it does at 
least in this case). However, this bug has existed in the bindings from 
the beginning.

The changeset is http://trac.osgeo.org/gdal/changeset/24117

Ari



More information about the gdal-dev mailing list