Re: Bug in HttpWebRequest/Response Dispose() implementation?
- From: "Vagif Abilov" <vagif@xxxxxxxxx>
- Date: Wed, 5 Jul 2006 23:53:16 +0200
Well, the problem we discovered was actually in our code running on .NET 2.0
:-(
We will investigate more, but first impression - the problem is still there,
since "using" does not work and GC.Collect does.
Vagif
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1f163f10c600e81298d2c6@xxxxxxxxxxxxxxxxxxxxxxx
Vagif Abilov <vagif@xxxxxxxxx> wrote:
I am not in the office right now, but I guess the original code looked
like
this:
HttpWebRequest request = PrepareRequest(...);
using(HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
... do something with response
}
HttpWebRequest is not disposable, so we applied "using" pattern to
HttpWebResponse object only.
While searching for the source of the problem, I found couple of
documents:
http://dturini.blogspot.com/2004/06/on-past-few-days-im-dealing-with-some.html
http://support.microsoft.com/?kbid=831138
Looks like there .NET 1.1 had a problem with release of unmanaged
resources
allocated by HttpResponse. Does .NET 2.0 has the same problem?
Hmm. Glad you've found it. I *suspect* that .NET 2.0 doesn't have the
same problem, given that it was fixed against 1.1 in the hotfix. I
wouldn't like to say for sure though.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- Bug in HttpWebRequest/Response Dispose() implementation?
- From: Vagif Abilov
- Re: Bug in HttpWebRequest/Response Dispose() implementation?
- From: Jon Skeet [C# MVP]
- Re: Bug in HttpWebRequest/Response Dispose() implementation?
- From: Vagif Abilov
- Re: Bug in HttpWebRequest/Response Dispose() implementation?
- From: Jon Skeet [C# MVP]
- Bug in HttpWebRequest/Response Dispose() implementation?
- Prev by Date: Re: Bug in HttpWebRequest/Response Dispose() implementation?
- Next by Date: Re: Starting a process "cmd.exe" from within a service...
- Previous by thread: Re: Bug in HttpWebRequest/Response Dispose() implementation?
- Next by thread: Re: Bug in HttpWebRequest/Response Dispose() implementation?
- Index(es):
Relevant Pages
|