diff --git a/src/War3Net.IO.Mpq/MpqStream.cs b/src/War3Net.IO.Mpq/MpqStream.cs index 6c36588a..b1143728 100644 --- a/src/War3Net.IO.Mpq/MpqStream.cs +++ b/src/War3Net.IO.Mpq/MpqStream.cs @@ -474,16 +474,6 @@ public override void Write(byte[] buffer, int offset, int count) throw new NotSupportedException("Write is not supported"); } - /// - public override void Close() - { - base.Close(); - if (_isStreamOwner) - { - _stream.Close(); - } - } - /// /// Copy the base stream, so that the contents do not get decompressed nor decrypted. /// @@ -760,5 +750,18 @@ private bool TryPeekCompressionType(int blockIndex, int expectedLength, out MpqC mpqCompressionType = (MpqCompressionType)buffer[0]; return true; } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (_isStreamOwner) + { + _stream.Close(); + } + } + + base.Dispose(disposing); + } } } \ No newline at end of file