+2009-01-21 Geoff Norton <gnorton@novell.com>
+
+ * WebClient_2_1.cs: Make the ManualResetEvent local to the callback
+ because a WebClient can be reused causing a wait-handle race here
+ allowing a delegate to get collected causing a crash.
+
2009-01-21 Chris Toshok <toshok@ximian.com>
* WebClient_2_1.cs: add 1 method back in, CancelAsync.
}
}
- private ManualResetEvent wait_event = new ManualResetEvent (false);
private object callback_args;
protected virtual void OnOpenReadCompleted (OpenReadCompletedEventArgs args)
{
CompleteAsync ();
if (OpenReadCompleted != null) {
+ ManualResetEvent wait_event = new ManualResetEvent (false);
GSourceFunc callback = (GSourceFunc) delegate (IntPtr ctx) { OpenReadCompleted (this, (OpenReadCompletedEventArgs) callback_args); wait_event.Set (); return false; };
callback_args = args;
{
CompleteAsync ();
if (DownloadStringCompleted != null) {
+ ManualResetEvent wait_event = new ManualResetEvent (false);
GSourceFunc callback = (GSourceFunc) delegate (IntPtr ctx) { DownloadStringCompleted (this, (DownloadStringCompletedEventArgs) callback_args); wait_event.Set (); return false; };
callback_args = args;