Access to Modified Closure

In this case, it’s okay, since you are actually executing the delegate within the loop. If you were saving the delegate and using it later, however, you’d find that all of the delegates would throw exceptions when trying to access files[i] – they’re capturing the variable i rather than its value at the time of … Read more