[geos-commits] r2926 - in trunk: include/geos/operation/polygonize
src/operation/polygonize
svn_geos at osgeo.org
svn_geos at osgeo.org
Mon Feb 22 17:21:32 EST 2010
Author: strk
Date: 2010-02-22 17:21:29 -0500 (Mon, 22 Feb 2010)
New Revision: 2926
Modified:
trunk/include/geos/operation/polygonize/Polygonizer.h
trunk/src/operation/polygonize/Polygonizer.cpp
Log:
LineStringAdder heap-allocation removal
Modified: trunk/include/geos/operation/polygonize/Polygonizer.h
===================================================================
--- trunk/include/geos/operation/polygonize/Polygonizer.h 2010-02-22 22:17:13 UTC (rev 2925)
+++ trunk/include/geos/operation/polygonize/Polygonizer.h 2010-02-22 22:21:29 UTC (rev 2926)
@@ -4,6 +4,7 @@
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
+ * Copyright (C) 2010 Sandro Santilli <strk at keybit.net>
* Copyright (C) 2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions Inc.
*
@@ -81,7 +82,7 @@
};
// default factory
- LineStringAdder *lineStringAdder;
+ LineStringAdder lineStringAdder;
/**
* Add a linestring to the graph of polygon edges.
Modified: trunk/src/operation/polygonize/Polygonizer.cpp
===================================================================
--- trunk/src/operation/polygonize/Polygonizer.cpp 2010-02-22 22:17:13 UTC (rev 2925)
+++ trunk/src/operation/polygonize/Polygonizer.cpp 2010-02-22 22:21:29 UTC (rev 2926)
@@ -4,6 +4,7 @@
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
+ * Copyright (C) 2010 Sandro Santilli <strk at keybit.net>
* Copyright (C) 2005-2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions Inc.
*
@@ -60,7 +61,7 @@
* as the input Geometry
*/
Polygonizer::Polygonizer():
- lineStringAdder(new Polygonizer::LineStringAdder(this)),
+ lineStringAdder(this),
graph(NULL),
dangles(),
cutEdges(),
@@ -73,7 +74,6 @@
Polygonizer::~Polygonizer()
{
- delete lineStringAdder;
delete graph;
for (unsigned int i=0, n=invalidRingLines.size(); i<n; ++i)
@@ -134,7 +134,7 @@
void
Polygonizer::add(Geometry *g)
{
- g->apply_ro(lineStringAdder);
+ g->apply_ro(&lineStringAdder);
}
/*
@@ -148,7 +148,7 @@
void
Polygonizer::add(const Geometry *g)
{
- g->apply_ro(lineStringAdder);
+ g->apply_ro(&lineStringAdder);
}
/*
More information about the geos-commits
mailing list