Repository navigation
Commit 80f9750
authored
fix(worker): tear down a worker runtime whose Java bootstrap failed (#2069)
When Runtime.initWorkerRuntime throws after the native runtime is built (for example internal/ts_helpers.js throws, or the logger does once the runtime is up), the runtime id is never returned, so WorkerWrapper::runtime_ stays null and BackgroundLooper skipped the teardown, leaving the runtime and its isolate allocated for the rest of the process. Shutdown now takes the thread's current runtime when runtime_ is null and tears it down on the existing path, detaching it from Java by its own id, since Java may still hold that runtime and its GC subscription.1 parent b5226a1 commit 80f9750
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
709 | 721 | | |
710 | 722 | | |
711 | 723 | | |
| |||
0 commit comments