Skip to content
Permalink
Browse files

Fix memory leak when restoring invalid geometry collection wkt

  • Loading branch information
nyalldawson committed Sep 25, 2017
1 parent ba50bf0 commit f15361390898f89198602ca21a3ac666c7d51d34
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/core/geometry/qgsgeometrycollection.cpp
@@ -530,7 +530,10 @@ bool QgsGeometryCollection::fromCollectionWkt( const QString &wkt, const QList<Q
QPair<QgsWkbTypes::Type, QString> parts = QgsGeometryUtils::wktReadBlock( wkt );

if ( QgsWkbTypes::flatType( parts.first ) != QgsWkbTypes::flatType( wkbType() ) )
{
qDeleteAll( subtypes );
return false;
}
mWkbType = parts.first;

QString defChildWkbType = QStringLiteral( "%1%2%3 " ).arg( defaultChildWkbType, is3D() ? "Z" : "", isMeasure() ? "M" : "" );

0 comments on commit f153613

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