diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-01-09 21:31:05 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-01-12 01:02:31 +0300 |
commit | a52328310c2c7a399a701c8c78dc4f1fda654c95 (patch) | |
tree | 8b24eb89f524602bd2ed00baad0ef12642cb2470 /src/stream_base-inl.h | |
parent | 2a94c9fa6a434f44d0941431b975f617cfe43152 (diff) |
http2: skip creating native ShutdownWrap
`ShutdownWrap` instances are being used to carry context between the
start and the asynchronous end of shutting down the writable side of
a `StreamBase`. HTTP/2 streams always perform this action
synchronously, so no such object is necessary.
PR-URL: https://github.com/nodejs/node/pull/31283
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/stream_base-inl.h')
-rw-r--r-- | src/stream_base-inl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 65af037d152..f89eb3a5287 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -162,7 +162,7 @@ inline int StreamBase::Shutdown(v8::Local<v8::Object> req_wrap_obj) { ShutdownWrap* req_wrap = CreateShutdownWrap(req_wrap_obj); int err = DoShutdown(req_wrap); - if (err != 0) { + if (err != 0 && req_wrap != nullptr) { req_wrap->Dispose(); } |