fix potential memory leak in SpatialTree (thanks to Bahram)