Navigation Menu

Skip to content

Commit

Permalink
[TD]Avoid double delete on cosmetic items
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Nov 7, 2019
1 parent fcf5435 commit 4027c78
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Mod/TechDraw/App/DrawViewPart.cpp
Expand Up @@ -1110,15 +1110,11 @@ int DrawViewPart::add1CVToGV(std::string tag)

//CosmeticEdges -------------------------------------------------------------------

//for completeness. not actually used anywhere
//for completeness. not actually used anywhere?
void DrawViewPart::clearCosmeticEdges(void)
{
std::vector<CosmeticEdge*> noEdges;
std::vector<CosmeticEdge*> edges = CosmeticEdges.getValues();
CosmeticEdges.setValues(noEdges);
for (auto& e: edges) {
delete e;
}
}

// adds a cosmetic edge to CosmeticEdges property
Expand Down Expand Up @@ -1290,11 +1286,7 @@ void DrawViewPart::addCosmeticEdgesToGeom(void)
void DrawViewPart::clearCenterLines(void)
{
std::vector<CenterLine*> noLines;
std::vector<CenterLine*> lines = CenterLines.getValues();
CenterLines.setValues(noLines);
for (auto& l: lines) {
delete l;
}
}

int DrawViewPart::addCenterLine(CenterLine* cl)
Expand Down

0 comments on commit 4027c78

Please sign in to comment.