mirror of
https://github.com/opensim/opensim.git
synced 2026-07-06 12:35:45 +08:00
* 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)
This commit is contained in:
@@ -95,16 +95,15 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
|
||||
|
||||
ManagedImage tmp;
|
||||
Image imgData;
|
||||
byte[] jpegdata;
|
||||
|
||||
OpenJPEG.DecodeToImage(asset.Data, out tmp, out imgData);
|
||||
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
||||
imgData.Save(ms, ImageFormat.Jpeg);
|
||||
|
||||
byte[] jpegdata = ms.GetBuffer();
|
||||
|
||||
ms.Close();
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
imgData.Save(ms, ImageFormat.Jpeg);
|
||||
jpegdata = ms.GetBuffer();
|
||||
}
|
||||
|
||||
resp.ContentType = "image/jpeg";
|
||||
resp.ContentLength = jpegdata.Length;
|
||||
|
||||
Reference in New Issue
Block a user