fix: call UnregisterIsolate
consistently (#28486)
This commit is contained in:
parent
63317627b5
commit
fe0da255b6
2 changed files with 6 additions and 4 deletions
|
@ -279,10 +279,6 @@ int NodeMain(int argc, char* argv[]) {
|
|||
node::Stop(env);
|
||||
node::FreeEnvironment(env);
|
||||
node::FreeIsolateData(isolate_data);
|
||||
|
||||
gin_env.platform()->DrainTasks(isolate);
|
||||
gin_env.platform()->CancelPendingDelayedTasks(isolate);
|
||||
gin_env.platform()->UnregisterIsolate(isolate);
|
||||
}
|
||||
|
||||
// According to "src/gin/shell/gin_main.cc":
|
||||
|
|
|
@ -160,6 +160,9 @@ JavascriptEnvironment::JavascriptEnvironment(uv_loop_t* event_loop)
|
|||
}
|
||||
|
||||
JavascriptEnvironment::~JavascriptEnvironment() {
|
||||
DCHECK_NE(platform_, nullptr);
|
||||
platform_->DrainTasks(isolate_);
|
||||
|
||||
{
|
||||
v8::Locker locker(isolate_);
|
||||
v8::HandleScope scope(isolate_);
|
||||
|
@ -167,6 +170,9 @@ JavascriptEnvironment::~JavascriptEnvironment() {
|
|||
}
|
||||
isolate_->Exit();
|
||||
g_isolate = nullptr;
|
||||
|
||||
platform_->CancelPendingDelayedTasks(isolate_);
|
||||
platform_->UnregisterIsolate(isolate_);
|
||||
}
|
||||
|
||||
class EnabledStateObserverImpl final
|
||||
|
|
Loading…
Reference in a new issue