Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test-app/runtime/src/main/cpp/WorkerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,18 @@ void WorkerWrapper::BackgroundLooper(std::shared_ptr<WorkerWrapper> self) {

isTerminating_ = true;

// A bootstrap that failed in Java after the native runtime was built (an
// exception from internal/ts_helpers.js, or from the logger once the
// runtime is up) never handed it back: initWorkerRuntime threw before
// returning its id. It is still this thread's current runtime, so it is
// torn down below like any other, and detached from Java by its own id.
if (runtime_ == nullptr) {
runtime_ = Runtime::GetCurrentRuntime();
if (runtime_ != nullptr) {
runtimeId = runtime_->GetId();
}
}

// Terminate any workers this worker created (nested workers). Their
// Worker object persistents live in this isolate, so they must be
// released before the isolate is disposed below. Each child cascades to
Expand Down
Loading