diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index fac2dabd1e..7b00597171 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -682,7 +682,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap mapitemsrequest.ContentLength = buffer.Length; //Count bytes to send os = mapitemsrequest.GetRequestStream(); os.Write(buffer, 0, buffer.Length); //Send it - os.Close(); //m_log.DebugFormat("[WORLD MAP]: Getting MapItems from {0}", httpserver); } catch (WebException ex) @@ -705,6 +704,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap responseMap["connect"] = OSD.FromBoolean(false); return responseMap; } + finally + { + if (os != null) + os.Close(); + } string response_mapItems_reply = null; { // get the response