From fb7d574d9e98c570ad0b4a348af32c153a06718b Mon Sep 17 00:00:00 2001 From: Oliver Tonnhofer Date: Fri, 3 Mar 2017 09:12:15 +0100 Subject: [PATCH] fix memory leak in Geom.Bounds GEOS envelope geometry was not destroyed when calculating the boundary. This leak was triggered with mappings with webmerc_area and imports with -limitto. (closes #139) --- geom/geos/geos.go | 1 + 1 file changed, 1 insertion(+) diff --git a/geom/geos/geos.go b/geom/geos/geos.go index a3f9433..d033952 100644 --- a/geom/geos/geos.go +++ b/geom/geos/geos.go @@ -322,6 +322,7 @@ func (this *Geom) Bounds() Bounds { if geom == nil { return NilBounds } + defer C.GEOSGeom_destroy(geom) extRing := C.GEOSGetExteriorRing(geom) if extRing == nil { return NilBounds