From bf43bf5417c5dc75a16eace1d39b70baec338ffd Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 21 Nov 2019 19:44:43 -0800 Subject: [PATCH] src: fix signal handler crash on close PR-URL: https://github.com/nodejs/node/pull/30582 Reviewed-By: Gireesh Punathil Reviewed-By: Anna Henningsen Reviewed-By: Beth Griggs Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson Reviewed-By: Denys Otrishko --- src/signal_wrap.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index cf67dc590f6d51..bc2d9f1e355efd 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -91,7 +91,10 @@ class SignalWrap : public HandleWrap { } void Close(v8::Local close_callback) override { - if (active_) DecreaseSignalHandlerCount(handle_.signum); + if (active_) { + DecreaseSignalHandlerCount(handle_.signum); + active_ = false; + } HandleWrap::Close(close_callback); }