fix: MessagePort closing unexpectedly with non-cloneable objects (#42582)
* fix: MessagePort closing unexpectedly with non-cloneable objects Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: handle serialization failure in parentPort Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
8534c9a469
commit
91de7d0f13
4 changed files with 34 additions and 3 deletions
|
@ -76,8 +76,11 @@ void MessagePort::PostMessage(gin::Arguments* args) {
|
|||
return;
|
||||
}
|
||||
|
||||
electron::SerializeV8Value(args->isolate(), message_value,
|
||||
&transferable_message);
|
||||
if (!electron::SerializeV8Value(args->isolate(), message_value,
|
||||
&transferable_message)) {
|
||||
// SerializeV8Value sets an exception.
|
||||
return;
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> transferables;
|
||||
std::vector<gin::Handle<MessagePort>> wrapped_ports;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue