You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to modify a geometry manually (not a common use case), with the surface, and region containing the halfspace having been defined from Python, I get a seg fault. Posting the code below if someone has an idea of why. My guess is memory ownership issues.
@param halfspace the side of that surface /
void Region::removeHalfspace(Surface surface, int halfspace) {
if (surface != NULL) {
std::vector<Region*>::iterator iter1;
/* Loop through nodes in region to check for the same Halfspace */
for ( ; iter1 != _nodes.end();) {
if (dynamic_cast<Halfspace*>(*iter1)) {
Halfspace* iter2 = dynamic_cast<Halfspace*>(*iter1);
if (iter2->getSurface()->getId() == surface->getId() &&
iter2->getHalfspace() == halfspace) {
//delete iter2; FIXME Memory leak (seg faults with and without)
_nodes.erase(iter1);
}
}
else
++iter1;
}
}
}
`
The text was updated successfully, but these errors were encountered:
When trying to modify a geometry manually (not a common use case), with the surface, and region containing the halfspace having been defined from Python, I get a seg fault. Posting the code below if someone has an idea of why. My guess is memory ownership issues.
`
/**
/
void Region::removeHalfspace(Surface surface, int halfspace) {
if (surface != NULL) {
}
}
`
The text was updated successfully, but these errors were encountered: