mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
fix: crash when drag-dropping some files (#46253)
* fix: crash when drag-dropping some files * fix: extra destination context scope
This commit is contained in:
@@ -687,17 +687,26 @@ v8::MaybeLocal<v8::Object> CreateProxyForAPI(
|
||||
continue;
|
||||
}
|
||||
}
|
||||
v8::Local<v8::Value> value;
|
||||
if (!api.Get(key, &value))
|
||||
continue;
|
||||
|
||||
auto passed_value = PassValueToOtherContextInner(
|
||||
source_context, source_execution_context, destination_context, value,
|
||||
api.GetHandle(), object_cache, support_dynamic_properties,
|
||||
recursion_depth + 1, error_target);
|
||||
if (passed_value.IsEmpty())
|
||||
return {};
|
||||
proxy.Set(key, passed_value.ToLocalChecked());
|
||||
{
|
||||
v8::Context::Scope source_context_scope(source_context);
|
||||
v8::Local<v8::Value> value;
|
||||
if (!api.Get(key, &value))
|
||||
continue;
|
||||
|
||||
auto passed_value = PassValueToOtherContextInner(
|
||||
source_context, source_execution_context, destination_context,
|
||||
value, api.GetHandle(), object_cache, support_dynamic_properties,
|
||||
recursion_depth + 1, error_target);
|
||||
if (passed_value.IsEmpty())
|
||||
return {};
|
||||
|
||||
{
|
||||
v8::Context::Scope inner_destination_context_scope(
|
||||
destination_context);
|
||||
proxy.Set(key, passed_value.ToLocalChecked());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return proxy.GetHandle();
|
||||
|
||||
Reference in New Issue
Block a user