fix: raw_ptr destruction order in NodeBindings (#39762)

This commit is contained in:
Charles Kerr 2023-09-07 18:25:17 -05:00 committed by GitHub
parent 0b44f433c8
commit 792037b338
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 44 deletions

View file

@ -10,7 +10,9 @@ namespace electron {
NodeBindingsLinux::NodeBindingsLinux(BrowserEnvironment browser_env)
: NodeBindings(browser_env), epoll_(epoll_create(1)) {
int backend_fd = uv_backend_fd(uv_loop_);
auto* const event_loop = uv_loop();
int backend_fd = uv_backend_fd(event_loop);
struct epoll_event ev = {0};
ev.events = EPOLLIN;
ev.data.fd = backend_fd;
@ -18,7 +20,9 @@ NodeBindingsLinux::NodeBindingsLinux(BrowserEnvironment browser_env)
}
void NodeBindingsLinux::PollEvents() {
int timeout = uv_backend_timeout(uv_loop_);
auto* const event_loop = uv_loop();
int timeout = uv_backend_timeout(event_loop);
// Wait for new libuv events.
int r;