fix: potential async_hooks
crash in NotifyWindowRestore
on Windows (#40576)
* fix: potential async_hooks crash in NotifyWindowRestore on Windows * fix: don't use CallbackScope for Error objects
This commit is contained in:
parent
db2bf1a0d1
commit
8104c7908a
4 changed files with 60 additions and 10 deletions
|
@ -61,12 +61,10 @@ void InvokeIpcCallback(v8::Local<v8::Context> context,
|
|||
|
||||
// Only set up the node::CallbackScope if there's a node environment.
|
||||
// Sandboxed renderers don't have a node environment.
|
||||
node::Environment* env = node::Environment::GetCurrent(context);
|
||||
std::unique_ptr<node::CallbackScope> callback_scope;
|
||||
if (env) {
|
||||
node::async_context async_context = {};
|
||||
callback_scope = std::make_unique<node::CallbackScope>(isolate, ipcNative,
|
||||
async_context);
|
||||
if (node::Environment::GetCurrent(context)) {
|
||||
callback_scope = std::make_unique<node::CallbackScope>(
|
||||
isolate, ipcNative, node::async_context{0, 0});
|
||||
}
|
||||
|
||||
auto callback_key = gin::ConvertToV8(isolate, callback_name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue