do not auto destroy BoundsPolygon

master
Oliver Tonnhofer 2013-12-02 11:43:44 +01:00
parent 34cf674fa0
commit 122bfc4f31
2 changed files with 2 additions and 1 deletions

View File

@ -160,7 +160,6 @@ func (this *Geos) BoundsPolygon(bounds Bounds) *Geom {
// geom inherited by Polygon, no destroy
geom = this.Polygon(geom, nil)
this.DestroyLater(geom)
return geom
}

View File

@ -88,6 +88,7 @@ func SplitPolygonAtGrid(g *geos.Geos, geom *geos.Geom, gridWidth, currentGridWid
return nil, errors.New("couldn't create bounds polygon")
}
part := g.Intersection(geom, clipGeom)
g.Destroy(clipGeom)
if part == nil {
return nil, errors.New("couldn't create intersection")
}
@ -96,6 +97,7 @@ func SplitPolygonAtGrid(g *geos.Geos, geom *geos.Geom, gridWidth, currentGridWid
result = append(result, part)
} else {
moreParts, err := SplitPolygonAtGrid(g, part, gridWidth, currentGridWidth/2.0)
g.Destroy(part)
if err != nil {
return nil, err
}