by accident the polygon was stored as a reference, however the original
variable went out of scope at the end of the loop, so the reference was
invalid afterwards.
it must of course not be stored as a reference but instead the struct
must own it.
also add the vector include. it was already there transiently, however
it's cleaner if we add it explicitly.
other minor fixes have been added as well.
by accident the polygon was stored as a reference, however the original variable went out of scope at the end of the loop, so the reference was invalid afterwards. it must of course not be stored as a reference but instead the struct must own it.
also add the
vector
include. it was already there transiently, however it's cleaner if we add it explicitly. other minor fixes have been added as well.