-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AN-8945: Call reset() to delete ByteStream in ResourceStream #307
Conversation
Wow, something is indeed not right here, and there are several possible fixes, if I understand correctly: Option 1: explicit
|
Okay, make sense for me for option 1. Should I update a new patch for this pull request? |
I would prefer your contribution to be properly acknowledged, and I think if you update your existing PR with our commonly-agreed "destruction" code pattern, then we can simply merge your PR as-is (rather than clone it, adjust it, etc.) |
Hi Daniel, |
Thanks for the updated PR! :) By the way, although I agree with the |
Ok, will create a new pull request for memory leak commits. |
Original implementation will cause huge memory leakages when Java layer acquire a resource, the ByteStream is never been released due to calling release() won't delete the memory allocation.
I'd change the _ptr.release() to _ptr.reset() to unlink the pointer and release the memory of ByteStream.