Skip to content

Commit

Permalink
Close small memory leak on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey committed Aug 9, 2024
1 parent af08e70 commit f6fc2e2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/operation/relateng/TopologyComputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,16 @@ TopologyComputer::getNodeSections(const CoordinateXY& nodePt)
void
TopologyComputer::addIntersection(NodeSection* a, NodeSection* b)
{
// add edges to node to allow full topology evaluation later
// we run this first (unlike JTS) in case the subsequent test throws
// an exception and the NodeSection pointers are not correctly
// saved in the memory managed store on the NodeSections, causing
// a small memeory leak
addNodeSections(a, b);

if (! a->isSameGeometry(b)) {
updateIntersectionAB(a, b);
}
//-- add edges to node to allow full topology evaluation later
addNodeSections(a, b);
}


Expand Down

0 comments on commit f6fc2e2

Please sign in to comment.