Skip to content

Commit 8ce9930

Browse files
committedSep 1, 2015
Fix leak in add map tool
1 parent 2904689 commit 8ce9930

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎python/core/geometry/qgsgeometry.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class QgsGeometry
4747
* geom is transferred.
4848
* @note added in QGIS 2.10
4949
*/
50-
QgsGeometry( QgsAbstractGeometryV2* geom /Transfer/ );
50+
explicit QgsGeometry( QgsAbstractGeometryV2* geom /Transfer/ );
5151

5252
//! Destructor
5353
~QgsGeometry();

‎src/app/qgsmaptooladdfeature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void QgsMapToolAddFeature::canvasMapReleaseEvent( QgsMapMouseEvent* e )
241241
poly = new QgsPolygonV2();
242242
}
243243
poly->setExteriorRing( curveToAdd );
244-
f->setGeometry( poly );
244+
f->setGeometry( new QgsGeometry( poly ) );
245245

246246
int avoidIntersectionsReturn = f->geometry()->avoidIntersections();
247247
if ( avoidIntersectionsReturn == 1 )

‎src/core/geometry/qgsgeometry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class CORE_EXPORT QgsGeometry
9090
* geom is transferred.
9191
* @note added in QGIS 2.10
9292
*/
93-
QgsGeometry( QgsAbstractGeometryV2* geom );
93+
explicit QgsGeometry( QgsAbstractGeometryV2* geom );
9494

9595
//! Destructor
9696
~QgsGeometry();

0 commit comments

Comments
 (0)
Please sign in to comment.