From ef7948f815b7ec451c243efabd6040f3da9d8d12 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 9 Dec 2005 12:00:06 +0000 Subject: [PATCH] Plugged memory leaks in Polygonize(). Version set to 1.0.7CVS git-svn-id: http://svn.osgeo.org/postgis/branches/pgis_1_0@2154 b70326c6-7e19-0410-871a-916f4a2858ee --- CHANGES | 3 +++ Version.config | 2 +- lwgeom/lwgeom_geos.c | 4 +++- lwgeom/lwgeom_geos_wrapper.cpp | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e8224f2f6..b089d2476 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +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 diff --git a/Version.config b/Version.config index 3e1900038..be09df634 100644 --- a/Version.config +++ b/Version.config @@ -4,7 +4,7 @@ # shared library version SO_MAJOR_VERSION=1 SO_MINOR_VERSION=0 -SO_MICRO_VERSION=6 +SO_MICRO_VERSION=7cvs # sql scripts version SCRIPTS_VERSION=0.3.0 diff --git a/lwgeom/lwgeom_geos.c b/lwgeom/lwgeom_geos.c index 1c2f6900e..9ad11b6a7 100644 --- a/lwgeom/lwgeom_geos.c +++ b/lwgeom/lwgeom_geos.c @@ -2468,7 +2468,9 @@ Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS) #ifdef PGIS_DEBUG elog(NOTICE, "GEOS_polygonize_garray: GEOSpolygonize returned"); #endif - //pfree(vgeoms); + for (i=0; i(polys->size()); for (i=0; isize(); i++) (*geoms)[i] = (*polys)[i]; out = geomFactory->createGeometryCollection(geoms); + delete polys; } catch (GEOSException *ge) { @@ -1722,6 +1723,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); -- 2.40.0