fix: dangling raw_ptr NodeBindings::uv_env_ (#42955)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-07-19 12:26:37 -05:00 committed by GitHub
parent bb093817ed
commit 0d9918cd24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -602,6 +602,7 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
node_env_->set_trace_sync_io(false);
js_env_->DestroyMicrotasksRunner();
node::Stop(node_env_.get(), node::StopFlags::kDoNotTerminateIsolate);
node_bindings_->set_uv_env(nullptr);
node_env_.reset();
auto default_context_key = ElectronBrowserContext::PartitionKey("", false);

View file

@ -155,10 +155,10 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
// Before then, we just exit() without any intermediate steps.
std::optional<int> exit_code_;
std::unique_ptr<NodeBindings> node_bindings_;
const std::unique_ptr<NodeBindings> node_bindings_;
// depends-on: node_bindings_
std::unique_ptr<ElectronBindings> electron_bindings_;
const std::unique_ptr<ElectronBindings> electron_bindings_;
// depends-on: node_bindings_
std::unique_ptr<JavascriptEnvironment> js_env_;