Skip to content

Commit

Permalink
Fix leak when constructing geometry from wkt with empty components
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 3, 2023
1 parent 19999d5 commit e81e5e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/geometry/qgsgeometrycollection.cpp
Expand Up @@ -758,7 +758,10 @@ bool QgsGeometryCollection::fromCollectionWkt( const QString &wkt, const QVector
secondWithoutParentheses = secondWithoutParentheses.remove( '(' ).remove( ')' ).simplified().remove( ' ' );
if ( ( parts.second.compare( QLatin1String( "EMPTY" ), Qt::CaseInsensitive ) == 0 ) ||
secondWithoutParentheses.isEmpty() )
{
qDeleteAll( subtypes );
return true;
}

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

Expand Down

0 comments on commit e81e5e8

Please sign in to comment.