[geos-commits] r4090 - trunk/src/operation/buffer

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Oct 1 08:22:06 PDT 2015


Author: strk
Date: 2015-10-01 08:22:06 -0700 (Thu, 01 Oct 2015)
New Revision: 4090

Modified:
   trunk/src/operation/buffer/BufferBuilder.cpp
Log:
Fix a memory leak in bufferLineSingleSided

The leak was exposed by an existing unit test

Modified: trunk/src/operation/buffer/BufferBuilder.cpp
===================================================================
--- trunk/src/operation/buffer/BufferBuilder.cpp	2015-09-10 08:49:15 UTC (rev 4089)
+++ trunk/src/operation/buffer/BufferBuilder.cpp	2015-10-01 15:22:06 UTC (rev 4090)
@@ -163,7 +163,7 @@
    }
 
    // Create MultiLineStrings from this polygon.
-   Geometry* bufLineString = buf->getBoundary();
+   std::auto_ptr<Geometry> bufLineString ( buf->getBoundary() );
 
 #ifdef GEOS_DEBUG_SSB
    std::cerr << "input|" << *l << std::endl;
@@ -339,7 +339,6 @@
    // Clean up.
    if ( noder != workingNoder ) delete noder;
    geomFact->destroyGeometry( buf );
-   geomFact->destroyGeometry( bufLineString );
    geomFact->destroyGeometry( singleSided );
    geomFact->destroyGeometry( intersectedLines );
 



More information about the geos-commits mailing list