mirror of https://github.com/quasar/Quasar.git
Dispose of the memory stream in Helper class
Disposes of the memory stream created in the server's helper class that converts an image.
This commit is contained in:
parent
79f9ca0cba
commit
c6b57f8110
|
@ -29,9 +29,11 @@ public static string GetRandomName(int length)
|
|||
|
||||
public static Image CByteToImg(byte[] img)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(img, 0, img.Length);
|
||||
ms.Write(img, 0, img.Length);
|
||||
return Image.FromStream(ms, true);
|
||||
using (MemoryStream ms = new MemoryStream(img, 0, img.Length))
|
||||
{
|
||||
ms.Write(img, 0, img.Length);
|
||||
return Image.FromStream(ms, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetFileSize(long size)
|
||||
|
|
Loading…
Reference in New Issue