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