Skip to content
Permalink
Browse files

Fix crash if merge geometries fails

  • Loading branch information
mhugent committed Jun 27, 2013
1 parent 26fbc36 commit b1fe1c314c21d6df9015b7df3a7d716aec4f4bcb
Showing with 10 additions and 6 deletions.
  1. +5 −6 src/app/qgisapp.cpp
  2. +5 −0 src/core/qgsgeometry.cpp
@@ -4765,17 +4765,16 @@ QgsGeometry* QgisApp::unionGeometries( const QgsVectorLayer* vl, QgsFeatureList&
{
backupPtr = unionGeom;
unionGeom = unionGeom->combine( currentGeom );
if ( !unionGeom )
{
delete backupPtr;
QApplication::restoreOverrideCursor();
return 0;
}
if ( i > 1 ) //delete previous intermediate results
{
delete backupPtr;
backupPtr = 0;
}
if ( !unionGeom )
{
QApplication::restoreOverrideCursor();
return 0;
}
}
}

@@ -6565,6 +6565,11 @@ QgsGeometry* QgsGeometry::combine( QgsGeometry* geometry )
try
{
GEOSGeometry* unionGeom = GEOSUnion( mGeos, geometry->mGeos );
if ( !unionGeom )
{
return 0;
}

if ( type() == QGis::Line )
{
GEOSGeometry* mergedGeom = GEOSLineMerge( unionGeom );

0 comments on commit b1fe1c3

Please sign in to comment.
You can’t perform that action at this time.