Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
geom: avoid racing with GC when calling Coords() on shell/hole
The problem is twofold: - In Geometry.Coords() we have to make sure the parent Geometry outlives the processing of the coordinates array. - The previous condition is not enough when the geometry comes from Shell() or Holes(), which return internal objects. We have to make sure the shell/hole parent geometry outlives the shell/hole instance. The fix is similar to the one suggested in paulsmith#11. There are probably a lot of places where either previous conditions are required, I have not checked all the code. Note: this change the minimum required Go version to 1.7. I tried to play build tag games to have empty versions of the runtime.KeepAlive call, and failed. Fixes paulsmith#8
- Loading branch information