Skip to content
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

Fixed memory leak for RFCTYPE_XSTRING #246

Closed
wants to merge 1 commit into from
Closed

Fixed memory leak for RFCTYPE_XSTRING #246

wants to merge 1 commit into from

Conversation

samuel-c-allan
Copy link

Allocated byteValue in nwrfcsdk.cc:618 is not freed automatically (a fact that only becomes apparent if you transfer very large XSTRING types) resulting in a memory leak that is significant for applications that deal with large amounts of XSTRING data (my app would, for instance, would crash after a few minutes due to lack of memory - others will likely not experience it on this kind of scale, but the memory leak is nevertheless a concern in my opinion).

The fix is very simple and uses the finalizer feature of node-addon-api. Looking forward to your comments

nwrfcsdk.cc:618 - byteValue does not free automatically, added finalizer to free byteValue once no longer needed.
@bsrdjan
Copy link
Contributor

bsrdjan commented Feb 6, 2022

why is this closed, is it some undesired side-effect found during testing?

bsrdjan added a commit that referenced this pull request Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants