Commit 6ec9b30e authored by Dennis Nienhüser's avatar Dennis Nienhüser
Browse files

Fix memory leaks

parent a6b11551
......@@ -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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment