in h3_linkedGeo.c [110:131]
void H3_EXPORT(destroyLinkedMultiPolygon)(LinkedGeoPolygon *polygon) {
// flag to skip the input polygon
bool skip = true;
LinkedGeoPolygon *nextPolygon;
LinkedGeoLoop *nextLoop;
for (LinkedGeoPolygon *currentPolygon = polygon; currentPolygon != NULL;
currentPolygon = nextPolygon) {
for (LinkedGeoLoop *currentLoop = currentPolygon->first;
currentLoop != NULL; currentLoop = nextLoop) {
destroyLinkedGeoLoop(currentLoop);
nextLoop = currentLoop->next;
H3_MEMORY(free)(currentLoop);
}
nextPolygon = currentPolygon->next;
if (skip) {
// do not free the input polygon
skip = false;
} else {
H3_MEMORY(free)(currentPolygon);
}
}
}