From b8e22f02e79e84d29e65a46751d68235f93aa8e8 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 19 Dec 2013 14:08:46 +0200 Subject: Make sure Web streams are disposed after use --- .../CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/CoreModules/Scripting') diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index c3a8afd..a7237ea 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -488,9 +488,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest byte[] data = Util.UTF8.GetBytes(OutboundBody); Request.ContentLength = data.Length; - Stream bstream = Request.GetRequestStream(); - bstream.Write(data, 0, data.Length); - bstream.Close(); + using (Stream bstream = Request.GetRequestStream()) + bstream.Write(data, 0, data.Length); } try @@ -584,4 +583,4 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest Request.Abort(); } } -} \ No newline at end of file +} -- cgit v1.1