dispose some MemoryStreams
parent
ae191cd304
commit
eb93855d84
|
@ -163,13 +163,15 @@ namespace OpenSim.Data.MySQL
|
|||
|
||||
if (m_enableCompression)
|
||||
{
|
||||
using (GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data), CompressionMode.Decompress))
|
||||
using(GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data),
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
using(MemoryStream outputStream = new MemoryStream())
|
||||
{
|
||||
MemoryStream outputStream = new MemoryStream();
|
||||
WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
|
||||
// int compressedLength = asset.Data.Length;
|
||||
asset.Data = outputStream.ToArray();
|
||||
|
||||
}
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
|
||||
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
|
||||
|
|
|
@ -173,13 +173,15 @@ namespace OpenSim.Data.PGSQL
|
|||
|
||||
if (m_enableCompression)
|
||||
{
|
||||
using (GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data), CompressionMode.Decompress))
|
||||
using (GZipStream decompressionStream = new GZipStream( new MemoryStream(asset.Data),
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
using(MemoryStream outputStream = new MemoryStream())
|
||||
{
|
||||
MemoryStream outputStream = new MemoryStream();
|
||||
WebUtil.CopyStream(decompressionStream,outputStream,int.MaxValue);
|
||||
// int compressedLength = asset.Data.Length;
|
||||
asset.Data = outputStream.ToArray();
|
||||
|
||||
}
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
|
||||
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
|
||||
|
|
Loading…
Reference in New Issue