If you only call Dispose( ) without Close( ) first, the ZSTD_freeCCtx( ) function is not called, eventually leading to an out of memory error after creating and disposing of about 200 compression streams.
Also, if the Close( ) function were to throw an error while flushing the ZSTD stream, the memory would also not be released.
I created a pull request that I believe corrects the issue without changing any behavior.
If you only call Dispose( ) without Close( ) first, the ZSTD_freeCCtx( ) function is not called, eventually leading to an out of memory error after creating and disposing of about 200 compression streams.
Also, if the Close( ) function were to throw an error while flushing the ZSTD stream, the memory would also not be released.
I created a pull request that I believe corrects the issue without changing any behavior.