Object disposal and garbage collection prior to event triggering
问题 A piece of code was brought up by someone I was talking to: private void DownloadInformation(string id) { using (WebClient wc = new WebClient()) { wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DownloadStringCompleted); wc.DownloadStringAsync(new Uri("http://www.fake.com/" + id)); } } The above is a simplified version of this: (I have the author's permission to post the image.) What bothers me about that code is that an event handler is attached, DownloadStringAsync()