diff options
author | Justin Clark-Casey (justincc) | 2013-02-27 00:21:02 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-02-27 00:21:02 +0000 |
commit | 80c19b7cac52a57fd04966169c657400aeee3de8 (patch) | |
tree | 32c48c0d00da28ed091d8c6a671d43d1e9ab8bdb /OpenSim/Region/CoreModules/Scripting | |
parent | minor: Remove unnecessary very old System.Net reference in OpenSim.Region.Scr... (diff) | |
download | opensim-SC_OLD-80c19b7cac52a57fd04966169c657400aeee3de8.zip opensim-SC_OLD-80c19b7cac52a57fd04966169c657400aeee3de8.tar.gz opensim-SC_OLD-80c19b7cac52a57fd04966169c657400aeee3de8.tar.bz2 opensim-SC_OLD-80c19b7cac52a57fd04966169c657400aeee3de8.tar.xz |
Make sure we dispose of WebResponse, StreamReader and Stream in various places where we were not already.
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 689e8a7..f04fabe 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -838,13 +838,17 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
838 | try | 838 | try |
839 | { | 839 | { |
840 | WebRequest request = HttpWebRequest.Create(url); | 840 | WebRequest request = HttpWebRequest.Create(url); |
841 | //Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. | 841 | |
842 | //Ckrinke Stream str = null; | 842 | using (HttpWebResponse response = (HttpWebResponse)(request).GetResponse()) |
843 | HttpWebResponse response = (HttpWebResponse)(request).GetResponse(); | ||
844 | if (response.StatusCode == HttpStatusCode.OK) | ||
845 | { | 843 | { |
846 | Bitmap image = new Bitmap(response.GetResponseStream()); | 844 | if (response.StatusCode == HttpStatusCode.OK) |
847 | return image; | 845 | { |
846 | using (Stream s = response.GetResponseStream()) | ||
847 | { | ||
848 | Bitmap image = new Bitmap(s); | ||
849 | return image; | ||
850 | } | ||
851 | } | ||
848 | } | 852 | } |
849 | } | 853 | } |
850 | catch { } | 854 | catch { } |