summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-09-04 13:59:10 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-09-04 13:59:10 (GMT)
commit6ec9b30e7ab001964d0e8f71e0aaf57d5a4f3b11 (patch)
treeb7f117d7fa6f72c989ffad31aab14ab8ecf7bf3e
parenta6b115517b23943b2b5868d7e3473c051b7d2394 (diff)
Fix memory leaks
-rw-r--r--tools/vectorosm-tilecreator/NodeReducer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/vectorosm-tilecreator/NodeReducer.cpp b/tools/vectorosm-tilecreator/NodeReducer.cpp
index ee19298..e297623 100644
--- a/tools/vectorosm-tilecreator/NodeReducer.cpp
+++ b/tools/vectorosm-tilecreator/NodeReducer.cpp
@@ -51,11 +51,13 @@ void NodeReducer::process()
GeoDataLinearRing* prevRing = &(prevPolygon->outerBoundary());
GeoDataLinearRing* reducedRing = reduce(prevRing);
reducedPolygon->setOuterBoundary(*reducedRing);
+ delete reducedRing;
QVector<GeoDataLinearRing>& innerBoundaries = prevPolygon->innerBoundaries();
for(int i = 0; i < innerBoundaries.size(); i++) {
prevRing = &innerBoundaries[i];
- reducedRing = reduce(prevRing);
- reducedPolygon->appendInnerBoundary(*reducedRing);
+ GeoDataLinearRing* reducedInnerRing = reduce(prevRing);
+ reducedPolygon->appendInnerBoundary(*reducedInnerRing);
+ delete reducedInnerRing;
}
placemark->setGeometry(reducedPolygon);
}