nodejs: release dispatcher before environment teardown

This commit is contained in:
Adrien Beraud committed 2026-10-27 00:14:56 -04:00
1 parent 62e0ded803
commit af38323728
1 file changed
+1 -1
+1 -1
View File
@@ -367,7 +367,6 @@ struct RunnerState
state->closeError = error.what();
}
state->runner.join();
state->dispatcher.Release();
}
Napi::Error makeCloseError() const
@@ -386,6 +385,7 @@ struct RunnerState
auto state = *owner;
state->finished = true;
if (!state->envClosing) {
state->dispatcher.Release();
auto error = state->makeCloseError();
for (auto& pending : state->operations)
pending.second.deferred.Reject(error.Value());