Skip to content

Commit

Permalink
Fix memory leak in filter multipoint
Browse files Browse the repository at this point in the history
(cherry-picked from 73f3164)
  • Loading branch information
nyalldawson committed Aug 14, 2018
1 parent 802f7f5 commit e84f37b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/geometry/qgsmultipoint.cpp
Expand Up @@ -189,10 +189,21 @@ void QgsMultiPoint::filterVertices( const std::function<bool ( const QgsPoint &
{
if ( const QgsPoint *point = qgsgeometry_cast< const QgsPoint * >( part ) )
{
return !filter( *point );
if ( !filter( *point ) )
{
delete point;
return true;
}
else
{
return false;
}
}
else
{
delete part;
return true;
}
} ), mGeometries.end() ); // clazy:exclude=detaching-member
}

Expand Down

0 comments on commit e84f37b

Please sign in to comment.