fix halo memory leaks