-
Notifications
You must be signed in to change notification settings - Fork 285
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
Memory leak in Root
#750
Memory leak in Root
#750
Conversation
fc9863d
to
41d30b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, it's just a little bit subtle and I don't 100% understand yet. How did the ManuallyDrop
logic prevent the queue reference count from decrementing, and how does the Option
fix that?
@dherman Since This changes the strategy so |
41d30b7
to
80a3395
Compare
80a3395
to
51a17a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Fixes a memory leak in
Root
reported in #746.This PR includes two commits:
0
.This is the bug referenced above. It stems from a misunderstanding of N-API. It's not sufficient to decrement the reference count to
0
, the reference must also be deleted.Option
to store the reference instead of usingManuallyDrop
.While not as extreme, the global event queue reference counter was always incrementing. It would never be freed, event after the context ended.