Plugged memory leaks in Polygonize().

git-svn-id: http://svn.osgeo.org/postgis/trunk@2155 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2005-12-09 12:00:29 +00:00
parent e19fc98d93
commit 08b5213a11
4 changed files with 10 additions and 2 deletions

View file

@ -31,6 +31,9 @@ PostGIS 1.1.0CVS
- SnapToGrid doesn't discard higher dimensions
- NEW SnapToGrid(geometry, point offset, xsize, ysize, zsize, msize)
PostGIS 1.0.7CVS
- Fixed memory leak in polygonize()
PostGIS 1.0.6
2005/12/06
- Fixed palloc(0) call in collection deserializer (only gives

View file

@ -2629,7 +2629,9 @@ Datum polygonize_garray(PG_FUNCTION_ARGS)
#ifdef PGIS_DEBUG
elog(NOTICE, "polygonize_garray: GEOSpolygonize returned");
#endif
//pfree(vgeoms);
for (i=0; i<nelems; ++i) GEOSdeleteGeometry(vgeoms[i]);
pfree(vgeoms);
if ( ! geos_result ) PG_RETURN_NULL();
GEOSSetSRID(geos_result, SRID);

View file

@ -2645,7 +2645,9 @@ Datum polygonize_garray(PG_FUNCTION_ARGS)
#ifdef PGIS_DEBUG
elog(NOTICE, "polygonize_garray: GEOSpolygonize returned");
#endif
//pfree(vgeoms);
for (i=0; i<nelems; ++i) GEOSGeom_destroy(vgeoms[i]);
pfree(vgeoms);
if ( ! geos_result ) PG_RETURN_NULL();
GEOSSetSRID(geos_result, SRID);

View file

@ -1770,6 +1770,7 @@ bool
GEOSHasZ(Geometry *g)
{
//char msg[256];
if ( g->isEmpty() ) return false;
double az = g->getCoordinate()->z;
//sprintf(msg, "ZCoord: %g", az);
//NOTICE_MESSAGE(msg);