summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Rahn <[email protected]>2015-10-25 12:59:10 +0100
committerTorsten Rahn <[email protected]>2015-10-25 12:59:10 +0100
commit58365875583ac46ec5ca7ce5243fd688f763768d (patch)
tree560aee271a652a2ca2ff198606fc81d694a0874f
parentc4144f504a5d8377991a7fbb321cd83bc49a6731 (diff)
Memleak fix and cleanup in GeoGraphicsPolygonItem::screenPolygon().
-rw-r--r--src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp b/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
index d5f2142..fca3fc9 100644
--- a/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
+++ b/src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
@@ -416,14 +416,12 @@ void GeoPolygonGraphicsItem::paint( GeoPainter* painter, const ViewportParams* v
void GeoPolygonGraphicsItem::screenPolygons(const ViewportParams *viewport, const GeoDataPolygon * polygon, QVector<QPolygonF*> & polygons, QVector<QPolygonF*> & outlines) {
- if (!polygon) return;
- QRectF const viewportRect(QPointF(0.0,0.0), viewport->size());
+ Q_ASSERT(polygon);
+
QVector<QPolygonF*> outerPolygons;
viewport->screenCoordinates( polygon->outerBoundary(), outerPolygons );
- foreach( QPolygonF* outerPolygon, outerPolygons ) {
- outlines << new QPolygonF(*outerPolygon);
- }
+ outlines << outerPolygons;
bool const hasInnerBoundaries = !m_polygon->innerBoundaries().isEmpty();