Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use array delete operator on geometry
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9207 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 29, 2008
1 parent 6eb7eb3 commit ed79d12
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/qgsgeometry.cpp
Expand Up @@ -74,6 +74,8 @@ void throwGEOSException( const char *fmt, ... )
vsnprintf( msg, buflen + 1, fmt, ap );
va_end( ap );

QgsDebugMsg( QString( "GEOS exception encountered: " ).arg( msg ) );

throw GEOSException( msg );
}

Expand Down Expand Up @@ -628,7 +630,7 @@ void QgsGeometry::setGeos( GEOSGeometry* geos )
}
if ( mGeometry )
{
delete mGeometry;
delete [] mGeometry;
mGeometry = 0;
}

Expand Down Expand Up @@ -1756,7 +1758,7 @@ bool QgsGeometry::deleteVertexAt( int atVertex )
}
if ( success )
{
delete mGeometry;
delete [] mGeometry;
mGeometry = newbuffer;
mGeometrySize -= ( 2 * sizeof( double ) );
if ( hasZValue )
Expand Down Expand Up @@ -2060,7 +2062,7 @@ bool QgsGeometry::insertVertexBefore( double x, double y, int beforeVertex )

if ( success )
{
delete mGeometry;
delete [] mGeometry;
mGeometry = newbuffer;
mGeometrySize += 2 * sizeof( double );
if ( hasZValue )
Expand Down Expand Up @@ -4531,7 +4533,7 @@ bool QgsGeometry::convertToMultiType()
//copy the existing single geometry
memcpy( &newGeometry[currentWkbPosition], mGeometry, mGeometrySize );

delete mGeometry;
delete [] mGeometry;
mGeometry = newGeometry;
mGeometrySize = newGeomSize;
mDirtyGeos = true;
Expand Down

0 comments on commit ed79d12

Please sign in to comment.