Skip to content

domain: use strong reference to domain while active

When an uncaught exception is thrown inside a domain, the domain is removed from the stack as of 43a51708. This means that it might not be kept alive as an object anymore, and may be garbage collected before the after() hook can run, which tries to exit it as well.

Resolve that by making references to the domain strong while it is active.

Fixes: https://github.com/nodejs/node/issues/28275

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading