Foreach need to clear it?

If you look at the implementation of the ForEachLoop node, you’ll see that the array is not stored inside the node ever. It just always re-evaluates your input, so it won’t store any references to your array.