fix: destruction order of js env fields (#39521)

isolate_ depends on isolate_holder_ and so must be destroyed first.
This commit is contained in:
Charles Kerr 2023-08-16 23:06:24 -05:00 committed by GitHub
parent b04ce6a5c8
commit dd8df3b0c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -104,9 +104,10 @@ gin::IsolateHolder CreateIsolateHolder(v8::Isolate* isolate) {
JavascriptEnvironment::JavascriptEnvironment(uv_loop_t* event_loop,
bool setup_wasm_streaming)
: isolate_(Initialize(event_loop, setup_wasm_streaming)),
isolate_holder_(CreateIsolateHolder(isolate_)),
locker_(isolate_) {
: isolate_holder_{CreateIsolateHolder(
Initialize(event_loop, setup_wasm_streaming))},
isolate_{isolate_holder_.isolate()},
locker_{isolate_} {
isolate_->Enter();
v8::HandleScope scope(isolate_);