mirror of
https://github.com/opensim/opensim.git
synced 2026-05-14 10:45:40 +08:00
Make sure we dispose of WebResponse, StreamReader and Stream in various places where we were not already.
This commit is contained in:
@@ -838,13 +838,17 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||
try
|
||||
{
|
||||
WebRequest request = HttpWebRequest.Create(url);
|
||||
//Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used.
|
||||
//Ckrinke Stream str = null;
|
||||
HttpWebResponse response = (HttpWebResponse)(request).GetResponse();
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
|
||||
using (HttpWebResponse response = (HttpWebResponse)(request).GetResponse())
|
||||
{
|
||||
Bitmap image = new Bitmap(response.GetResponseStream());
|
||||
return image;
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
using (Stream s = response.GetResponseStream())
|
||||
{
|
||||
Bitmap image = new Bitmap(s);
|
||||
return image;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
Reference in New Issue
Block a user