fix: raw_ptr destruction order in NodeBindings (#39762)
This commit is contained in:
parent
0b44f433c8
commit
792037b338
7 changed files with 69 additions and 44 deletions
|
@ -27,10 +27,10 @@
|
|||
namespace electron {
|
||||
|
||||
ElectronRendererClient::ElectronRendererClient()
|
||||
: node_bindings_(
|
||||
NodeBindings::Create(NodeBindings::BrowserEnvironment::kRenderer)),
|
||||
electron_bindings_(
|
||||
std::make_unique<ElectronBindings>(node_bindings_->uv_loop())) {}
|
||||
: node_bindings_{NodeBindings::Create(
|
||||
NodeBindings::BrowserEnvironment::kRenderer)},
|
||||
electron_bindings_{
|
||||
std::make_unique<ElectronBindings>(node_bindings_->uv_loop())} {}
|
||||
|
||||
ElectronRendererClient::~ElectronRendererClient() = default;
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ class ElectronRendererClient : public RendererClientBase {
|
|||
// Whether the node integration has been initialized.
|
||||
bool node_integration_initialized_ = false;
|
||||
|
||||
std::unique_ptr<NodeBindings> node_bindings_;
|
||||
std::unique_ptr<ElectronBindings> electron_bindings_;
|
||||
const std::unique_ptr<NodeBindings> node_bindings_;
|
||||
const std::unique_ptr<ElectronBindings> electron_bindings_;
|
||||
|
||||
// The node::Environment::GetCurrent API does not return nullptr when it
|
||||
// is called for a context without node::Environment, so we have to keep
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue