You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Brain2000
changed the title
If you only call Dispose( ) without Close( ) first, the ZSTD_freeCCtx( ) function is not called, leading to an out of memory error. Also, if the Close( ) function were to throw an error while flushing the ZSTD stream, the memory would also not be released. By using try/finally on the Close( ), and adding a safety net to Dispose( ) in case Close( ) is not called, the issue seems to be corrected. Note that if you only call Dispose( ), it will not flush the stream, which does not modify the current behavior. A new function to release resources has been added in order to keep from duplicating code in both Close and DIspose.
Unmanaged resource leak
Feb 18, 2019
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.
The text was updated successfully, but these errors were encountered: