Using ref to pointer in sparse array delete to nullify the ptr after release.