File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -619,13 +619,16 @@ inline int Http2Session::OnStreamClose(nghttp2_session* handle,
619619 if (stream != nullptr ) {
620620 stream->Close (code);
621621 // It is possible for the stream close to occur before the stream is
622- // ever passed on to the javascript side. If that happens, ignore this.
622+ // ever passed on to the javascript side. If that happens, skip straight
623+ // to destroying the stream
623624 Local<Value> fn =
624625 stream->object ()->Get (context, env->onstreamclose_string ())
625626 .ToLocalChecked ();
626627 if (fn->IsFunction ()) {
627628 Local<Value> argv[1 ] = { Integer::NewFromUnsigned (isolate, code) };
628629 stream->MakeCallback (fn.As <Function>(), arraysize (argv), argv);
630+ } else {
631+ stream->Destroy ();
629632 }
630633 }
631634 return 0 ;
You can’t perform that action at this time.
0 commit comments