Hello,<br><br>I'm trying to edit Geometry using class CoordinateOperation. My implementation of CoordinateOperation::edit function looks like follows:<br><br><br><span style="font-family:courier new,monospace">CoordinateSequence* VertexGeometryEditorOperation::edit(const CoordinateSequence *, const Geometry *geom )<br>
{<br>    CoordinateSequence* coord = geom->getCoordinates();<br><br>    for ( size_t i = 0; i < coord->getSize(); i++)<br>    {<br>            coord->setAt( closeCoord->getAt(i)+number, i );<br>    }<br><br>
    return coord;<br><br>}</span><br><br>Everything works fine, but when I check it with walgrind it returned these memory leaks:<br><br><span style="font-family:courier new,monospace">==19845== 168 bytes in 3 blocks are possibly lost in loss record 335 of 426<br>
==19845==    at 0x4C2C154: operator new(unsigned long) (vg_replace_malloc.c:298)<br>==19845==    by 0xF206682: geos::geom::GeometryFactory::createLinearRing(geos::geom::CoordinateSequence*) const (GeometryFactory.cpp:411)<br>
==19845==    by 0xF211A31: geos::geom::util::CoordinateOperation::edit(geos::geom::Geometry const*, geos::geom::GeometryFactory const*) (CoordinateOperation.cpp:38)<br>==19845==    by 0xF2123D6: geos::geom::util::GeometryEditor::editPolygon(geos::geom::Polygon const*, geos::geom::util::GeometryEditorOperation*) (GeometryEditor.cpp:117)<br>
==19845==    by 0xF212273: geos::geom::util::GeometryEditor::edit(geos::geom::Geometry const*, geos::geom::util::GeometryEditorOperation*) (GeometryEditor.cpp:88)<br>==19845==    by 0xBFB30FE: geoc::alg::VertexSnapper::snapVertices(geoc::geo::GEOCGeom*, geos::geom::CoordinateSequence*) (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/geoc_cpp/libgeoc.so.1.0.0)<br>
==19845==    by 0xBFB33A1: geoc::alg::VertexSnapper::snap() (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/geoc_cpp/libgeoc.so.1.0.0)<br>==19845==    by 0x566782E: QgsConflateProvider::vertexSnap() (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/qgsconflate/libqgsconflate.so.1.0.0)<br>
==19845==    by 0x401C65: main (main.cpp:85)<br><br>==19845== 192 bytes in 3 blocks are possibly lost in loss record 347 of 426<br>==19845==    at 0x4C2C154: operator new(unsigned long) (vg_replace_malloc.c:298)<br>==19845==    by 0xF206ACA: geos::geom::GeometryFactory::createPolygon(geos::geom::LinearRing*, std::vector<geos::geom::Geometry*, std::allocator<geos::geom::Geometry*> >*) const (GeometryFactory.cpp:525)<br>
==19845==    by 0xF212568: geos::geom::util::GeometryEditor::editPolygon(geos::geom::Polygon const*, geos::geom::util::GeometryEditorOperation*) (GeometryEditor.cpp:144)<br>==19845==    by 0xF212273: geos::geom::util::GeometryEditor::edit(geos::geom::Geometry const*, geos::geom::util::GeometryEditorOperation*) (GeometryEditor.cpp:88)<br>
==19845==    by 0xBFB30FE: geoc::alg::VertexSnapper::snapVertices(geoc::geo::GEOCGeom*, geos::geom::CoordinateSequence*) (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/geoc_cpp/libgeoc.so.1.0.0)<br>==19845==    by 0xBFB33A1: geoc::alg::VertexSnapper::snap() (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/geoc_cpp/libgeoc.so.1.0.0)<br>
==19845==    by 0x566782E: QgsConflateProvider::vertexSnap() (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/qgsconflate/libqgsconflate.so.1.0.0)<br>==19845==    by 0x401C65: main (main.cpp:85)<br><br><br>==19845== 408 bytes in 3 blocks are possibly lost in loss record 382 of 426<br>
==19845==    at 0x4C2C154: operator new(unsigned long) (vg_replace_malloc.c:298)<br>==19845==    by 0xF1FABE5: geos::geom::CoordinateArraySequence::CoordinateArraySequence(geos::geom::CoordinateArraySequence const&) (new_allocator.h:92)<br>
==19845==    by 0xF1FACD8: geos::geom::CoordinateArraySequence::clone() const (CoordinateArraySequence.cpp:77)<br>==19845==    by 0xBFB7B6C: geoc::edit::VertexGeometryEditorOperation::edit(geos::geom::CoordinateSequence const*, geos::geom::Geometry const*) (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/geoc_cpp/libgeoc.so.1.0.0)<br>
==19845==    by 0xF211A26: geos::geom::util::CoordinateOperation::edit(geos::geom::Geometry const*, geos::geom::GeometryFactory const*) (CoordinateOperation.cpp:36)<br>==19845==    by 0xF2123D6: geos::geom::util::GeometryEditor::editPolygon(geos::geom::Polygon const*, geos::geom::util::GeometryEditorOperation*) (GeometryEditor.cpp:117)<br>
==19845==    by 0xF212273: geos::geom::util::GeometryEditor::edit(geos::geom::Geometry const*, geos::geom::util::GeometryEditorOperation*) (GeometryEditor.cpp:88)<br>==19845==    by 0xBFB30FE: geoc::alg::VertexSnapper::snapVertices(geoc::geo::GEOCGeom*, geos::geom::CoordinateSequence*) (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/geoc_cpp/libgeoc.so.1.0.0)<br>
==19845==    by 0xBFB33A1: geoc::alg::VertexSnapper::snap() (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/geoc_cpp/libgeoc.so.1.0.0)<br>==19845==    by 0x566782E: QgsConflateProvider::vertexSnap() (in /host/Users/Tereza/Documents/CVUT-FSv/BP/src/qgsconflate/libqgsconflate.so.1.0.0)<br>
==19845==    by 0x401C65: main (main.cpp:85)</span><br><br>...<br><br>Anybody knows how to fix that?<br><br>Thanks,<br><br>Tereza<br><br>