Skip to content

Commit e84f37b

Browse files
committedAug 14, 2018
Fix memory leak in filter multipoint
(cherry-picked from 73f3164)
1 parent 802f7f5 commit e84f37b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎src/core/geometry/qgsmultipoint.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,21 @@ void QgsMultiPoint::filterVertices( const std::function<bool ( const QgsPoint &
189189
{
190190
if ( const QgsPoint *point = qgsgeometry_cast< const QgsPoint * >( part ) )
191191
{
192-
return !filter( *point );
192+
if ( !filter( *point ) )
193+
{
194+
delete point;
195+
return true;
196+
}
197+
else
198+
{
199+
return false;
200+
}
193201
}
194202
else
203+
{
204+
delete part;
195205
return true;
206+
}
196207
} ), mGeometries.end() ); // clazy:exclude=detaching-member
197208
}
198209

0 commit comments

Comments
 (0)