[geos-devel] using CoordinateOperation::edit cause memory leaks

Tereza Fiedlerová tfiedlerova at gmail.com
Wed May 22 09:59:05 PDT 2013


I deleted geosGeom from example and the first leak is gone (thank
you), but the second one concerned wkt [1] doesn't. Do you know how to
solve this one?


==7557== 592 (64 direct, 528 indirect) bytes in 1 blocks are
definitely lost in loss record 11 of 11
==7557==    at 0x4C2C154: operator new(unsigned long) (vg_replace_malloc.c:298)
==7557==    by 0x4ED5CEA:
std::allocator<geos::geom::Geometry*> >*) const (in
==7557==    by 0x4F09E3E:
geos::io::WKTReader::readPolygonText(geos::io::StringTokenizer*) (in
==7557==    by 0x4F0B053:
(in /usr/lib/libgeos-3.3.3.so)
==7557==    by 0x4F0B49B: geos::io::WKTReader::read(std::string
const&) (in /usr/lib/libgeos-3.3.3.so)
==7557==    by 0x400EAD: main (in

2013/5/22 Sandro Santilli <strk at keybit.net>:
> On Wed, May 22, 2013 at 09:58:20AM +0200, Tereza Fiedlerová wrote:
>> Hi,
>> I'm sorry for my long reaction time, but I have still the same problem
>> and I hope you still can help me. I tried to create a minimal example.
>> This example returns both my problems - memory leak because of using
>> WKT and also the problem with GeometryEditorOperation as I wrote
>> before.
>> The input is simple wkt polygon and I just trying to change its
>> position. The main.cpp file is attached to this email.
> Tereza, the GeometryEditor::edit method is documented [1] to return
> a _new_ Geometry, so it's up to you to delete the one you passed to it,
> just do that and all leaks are gone.
> [1] http://trac.osgeo.org/geos/browser/tags/3.3.8/include/geos/geom/util/GeometryEditor.h#L118
> --strk;
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel

More information about the geos-devel mailing list