stratisproject / StratisBitcoinFullNode

Bitcoin full node in C#
https://stratisplatform.com
MIT License
787 stars 312 forks source link

[ScriptReader] Undisposed -> Leak? #801

Closed Aprogiena closed 6 years ago

Aprogiena commented 6 years ago

NBitcoin.ScriptReader is not IDisposable, but it contains inner Stream, often MemoryStream. Should not this inner stream be disposed?

fassadlr commented 6 years ago

@Aprogiena I suppose ScriptReader should be made IDisposable so that you can dispose of the Stream when Dispose gets called?

using(var reader = new ScriptReader(_Script)
{
}
Aprogiena commented 6 years ago

yes that's what i was thinking, but as always, this will require change in quite a lot of code but what can you do :-)