From e96b1613a4dd9bfa1d47e9a493727fc0f385db9a Mon Sep 17 00:00:00 2001 From: Robo Date: Thu, 3 Aug 2023 21:30:19 +0900 Subject: [PATCH] fix: destroy message port backend when JS env exits (#39335) --- shell/browser/api/message_port.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shell/browser/api/message_port.h b/shell/browser/api/message_port.h index 2f4cb3480caa..70fe2add2de8 100644 --- a/shell/browser/api/message_port.h +++ b/shell/browser/api/message_port.h @@ -11,6 +11,7 @@ #include "gin/wrappable.h" #include "mojo/public/cpp/bindings/connector.h" #include "mojo/public/cpp/bindings/message.h" +#include "shell/common/gin_helper/cleaned_up_at_exit.h" #include "third_party/blink/public/common/messaging/message_port_channel.h" #include "third_party/blink/public/common/messaging/message_port_descriptor.h" @@ -23,7 +24,9 @@ class Handle; namespace electron { // A non-blink version of blink::MessagePort. -class MessagePort : public gin::Wrappable, mojo::MessageReceiver { +class MessagePort : public gin::Wrappable, + public gin_helper::CleanedUpAtExit, + public mojo::MessageReceiver { public: ~MessagePort() override; static gin::Handle Create(v8::Isolate* isolate);