thejefflarson/quadtree — pull request #2 by eadle (2014-03-31 21:25:05+00:00)
Title: Proper fix.

Hey Jeff, don't mean to bombard you with pull request or anything, but the current version gives a seg fault and I needed to make some modifications to preserve the old behavior.

I made the quadrant bounds inclusive to eliminate the case where insertion fails. It didn't make sense for a unique point to not be inserted if it was within the quadtree boundaries. quadtree_insert returns 0 when the point fails to insert (out of bounds), returns 1 with a normal insertion, and returns 2 when there is a replacement insertion. There was another strange memory leak that I was only able to track down by eliminating the case where insertion fails.

I made sure to test this one pretty thoroughly. I also have an OpenGL app if you are interested in me adding it as a benchmark tool. Thanks.