Skip to content

Commit

Permalink
CoreBoard: don't crash if net for plane is gone
Browse files Browse the repository at this point in the history
  • Loading branch information
carrotIndustries committed Dec 22, 2021
1 parent 08a866c commit 4a389f0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/core/core_board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,20 @@ void CoreBoard::reload_netlist()
it++;
}
}

// delete planes with deleted nets
for (auto it = brd->planes.begin(); it != brd->planes.end();) {
const auto &plane = it->second;
if (!block->nets.count(plane.net.uuid)) { // net is gone
plane.polygon->usage = nullptr;
brd->planes.erase(it++);
}
else {
it++;
}
}
brd->update_refs();

for (auto it = brd->tracks.begin(); it != brd->tracks.end();) {
bool del = false;
for (auto &it_ft : {it->second.from, it->second.to}) {
Expand Down

0 comments on commit 4a389f0

Please sign in to comment.