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
refactor: add a wrapper for wrangling uv handles. #25332
Conversation
Release Notes Persisted
|
* refactor: add a wrapper for wrangling uv handles. Part 1 of a fix for electron#25248, electron#22069. Place the uv_asyncs owned by NodeBindings, ElectronBindings inside a new UvHandle wrapper class which manages uv_handles' need for their closed() callback to be invoked before the handles' memory can be freed. * chore: make lint happy * refactor: use DCHECK_EQ() instead of DCHECK() * refactor: fix oops
/trop run backport-to 11-x-y,10-x-y |
The backport process for this PR has been manually initiated - |
The backport process for this PR has been manually initiated - |
I have automatically backported this PR to "11-x-y", please check out #25661 |
I have automatically backported this PR to "10-x-y", please check out #25662 |
/trop run backport-to 9-x-y |
The backport process for this PR has been manually initiated - |
I have automatically backported this PR to "9-x-y", please check out #25663 |
Description of Change
Part 1 of a fix for #25248, #22069.
Fixes #24965. (h/t @jkleinsc for spotting the connection)
This PR wraps the
uv_async_t
objects owned by NodeBindings and ElectronBindings inside a new UvHandle wrapper class which handlesuv_handle_t
s' specific rules about destruction:The UvHandle wrapper class handles this close-delete twostep so that client code doesn't have to think about it. Failure to finish closing before freeing is what caused the uv_walk() crash in #25248.
CC @codebytere
Checklist
npm test
passesRelease Notes
Notes: Fixed resource leak in worker threads.