Commit 43e5478e authored by Anna Henningsen's avatar Anna Henningsen Committed by Rich Trott
Browse files

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

PR-URL: https://github.com/nodejs/node/pull/28313


Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
Reviewed-By: default avatarVladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent 49eb2b8e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment