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

Fix crash happened in UvRunOnce #9043

Merged
merged 1 commit into from Mar 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions atom/common/node_bindings.cc
Expand Up @@ -232,6 +232,12 @@ void NodeBindings::RunMessageLoop() {
void NodeBindings::UvRunOnce() {
node::Environment* env = uv_env();

// When doing navigation without restarting renderer process, it may happen
// that the node environment is destroyed but the message loop is still there.
// In this case we should not run uv loop.
if (!env)
return;

// Use Locker in browser process.
mate::Locker locker(env->isolate());
v8::HandleScope handle_scope(env->isolate());
Expand Down