How can I properly destroy actors from an array inside a loop

get the length of the array and another variable, add to that variable every time an object is destroyed and minus the length and the variable to get the end of the loop