Make sure we dispose of WebResponse, StreamReader and Stream in various places where we were not already.

This commit is contained in:
Justin Clark-Casey (justincc)
2013-02-27 00:21:02 +00:00
parent 2bfbfc5725
commit 80c19b7cac
14 changed files with 243 additions and 210 deletions

View File

@@ -101,20 +101,11 @@ namespace OpenSim.Framework.Servers.HttpServer
using (WebResponse resp = request.GetResponse())
{
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
Stream respStream = null;
try
{
respStream = resp.GetResponseStream();
using (Stream respStream = resp.GetResponseStream())
deserial = (TResponse)deserializer.Deserialize(respStream);
}
catch { }
finally
{
if (respStream != null)
respStream.Close();
resp.Close();
}
}
return deserial;
}
}