From df389dceb8b9430049c3bedf3632b4df2eb91e15 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 17 Sep 2014 16:19:00 +0100 Subject: [PATCH] add some _response.close. RestClient still looks bad. It should be a proper IDisposable object. --- OpenSim/Framework/Communications/RestClient.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index de34250b7a..ce36fbf52d 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs @@ -326,6 +326,9 @@ namespace OpenSim.Framework.Communications m_log.Debug(e.ToString()); } + if (_response != null) + _response.Close(); + return null; } @@ -390,6 +393,9 @@ namespace OpenSim.Framework.Communications _response = (HttpWebResponse) _request.GetResponse(); + if (_response != null) + _response.Close(); + // IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request); // TODO! Implement timeout, without killing the server