[geos-commits] r3355 - trunk/src/geom/prep

svn_geos at osgeo.org svn_geos at osgeo.org
Thu May 12 02:20:11 EDT 2011


Author: strk
Date: 2011-05-11 23:20:11 -0700 (Wed, 11 May 2011)
New Revision: 3355

Modified:
   trunk/src/geom/prep/PreparedLineStringIntersects.cpp
Log:
Fix a memory leak in PreparedLineStringIntersects::isAnyPointInRing

Modified: trunk/src/geom/prep/PreparedLineStringIntersects.cpp
===================================================================
--- trunk/src/geom/prep/PreparedLineStringIntersects.cpp	2011-05-12 06:16:55 UTC (rev 3354)
+++ trunk/src/geom/prep/PreparedLineStringIntersects.cpp	2011-05-12 06:20:11 UTC (rev 3355)
@@ -38,7 +38,7 @@
 		 * This could be optimized by using the segment index on the lineal target.
 		 * However, it seems like the L/P case would be pretty rare in practice.
 		 */
-		PointLocator * locator = new PointLocator();
+		PointLocator  locator;
 
 		geom::Coordinate::ConstVect coords;
 		ComponentCoordinateExtracter::getCoordinates( *testGeom, coords);
@@ -46,18 +46,12 @@
 		for (size_t i=0, n=coords.size(); i<n; i++)
 		{
 			geom::Coordinate c = *(coords[i]);
-			if ( locator->intersects( c, &(prepLine.getGeometry()) ))
+			if ( locator.intersects( c, &(prepLine.getGeometry()) ))
 				return true;
 		}
 		return false;
 	}
 
-	//bool PreparedLineStringIntersects::intersects( const PreparedLineString * const prep, const geom::Geometry * geom ) 
-	//{
-	//	PreparedLineStringIntersects op = new PreparedLineStringIntersects( prep);
-	//	return op.intersects_( geom);
-	//}
-
 	bool PreparedLineStringIntersects::intersects(const geom::Geometry * g) const
 	{
 		// If any segments intersect, obviously intersects = true



More information about the geos-commits mailing list