aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Client
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-04 13:57:51 -0700
committerJohn Hurliman2009-10-04 13:57:51 -0700
commit29a4614529bbda02b9c690d2d1812be1d1e7bbae (patch)
tree89725829b37d502158a114c862a56a075b005b1b /OpenSim/Client
parentGuarding a line that is sometimes throwing a null pointer exception. (diff)
downloadopensim-SC_OLD-29a4614529bbda02b9c690d2d1812be1d1e7bbae.zip
opensim-SC_OLD-29a4614529bbda02b9c690d2d1812be1d1e7bbae.tar.gz
opensim-SC_OLD-29a4614529bbda02b9c690d2d1812be1d1e7bbae.tar.bz2
opensim-SC_OLD-29a4614529bbda02b9c690d2d1812be1d1e7bbae.tar.xz
* MySQL data tests now pass by fixing a bad fix for a bad cast on the asset Local member in MySQLAssetData
* First pass at applying the using(){} pattern to IDisposable objects. Always use the using pattern on IDisposable objects whenever possible, do not manually call .Close() or .Dispose() unless there is no other way to write the code. This pass mostly covers OpenSim.Data.MySQL, and should have no functional change (tests still pass)
Diffstat (limited to 'OpenSim/Client')
-rw-r--r--OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs13
1 files changed, 6 insertions, 7 deletions
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
index 8c9eb5f..c649c5a 100644
--- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
+++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
@@ -95,16 +95,15 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
95 95
96 ManagedImage tmp; 96 ManagedImage tmp;
97 Image imgData; 97 Image imgData;
98 byte[] jpegdata;
98 99
99 OpenJPEG.DecodeToImage(asset.Data, out tmp, out imgData); 100 OpenJPEG.DecodeToImage(asset.Data, out tmp, out imgData);
100
101 MemoryStream ms = new MemoryStream();
102 101
103 imgData.Save(ms, ImageFormat.Jpeg); 102 using (MemoryStream ms = new MemoryStream())
104 103 {
105 byte[] jpegdata = ms.GetBuffer(); 104 imgData.Save(ms, ImageFormat.Jpeg);
106 105 jpegdata = ms.GetBuffer();
107 ms.Close(); 106 }
108 107
109 resp.ContentType = "image/jpeg"; 108 resp.ContentType = "image/jpeg";
110 resp.ContentLength = jpegdata.Length; 109 resp.ContentLength = jpegdata.Length;