mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Make sure we dispose of WebResponse, StreamReader and Stream in various places where we were not already.
This commit is contained in:
@@ -868,20 +868,22 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
}
|
||||
|
||||
string response_mapItems_reply = null;
|
||||
{ // get the response
|
||||
StreamReader sr = null;
|
||||
{
|
||||
try
|
||||
{
|
||||
WebResponse webResponse = mapitemsrequest.GetResponse();
|
||||
if (webResponse != null)
|
||||
using (WebResponse webResponse = mapitemsrequest.GetResponse())
|
||||
{
|
||||
sr = new StreamReader(webResponse.GetResponseStream());
|
||||
response_mapItems_reply = sr.ReadToEnd().Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new OSDMap();
|
||||
}
|
||||
if (webResponse != null)
|
||||
{
|
||||
using (Stream s = webResponse.GetResponseStream())
|
||||
using (StreamReader sr = new StreamReader(s))
|
||||
response_mapItems_reply = sr.ReadToEnd().Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new OSDMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
@@ -908,11 +910,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
|
||||
return responseMap;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (sr != null)
|
||||
sr.Close();
|
||||
}
|
||||
|
||||
OSD rezResponse = null;
|
||||
try
|
||||
@@ -926,6 +923,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
{
|
||||
m_log.InfoFormat("[WORLD MAP]: exception on parse of RequestMapItems reply from {0}: {1}", httpserver, ex.Message);
|
||||
responseMap["connect"] = OSD.FromBoolean(false);
|
||||
|
||||
lock (m_blacklistedregions)
|
||||
{
|
||||
if (!m_blacklistedregions.ContainsKey(regionhandle))
|
||||
|
||||
Reference in New Issue
Block a user