File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -499,8 +499,8 @@ Http2Session::Http2Session(Environment* env,
499499Http2Session::~Http2Session () {
500500 CHECK_EQ (flags_ & SESSION_STATE_HAS_SCOPE, 0 );
501501 Debug (this , " freeing nghttp2 session" );
502- for (const auto & stream : streams_)
503- stream .second ->session_ = nullptr ;
502+ for (const auto & iter : streams_)
503+ iter .second ->session_ = nullptr ;
504504 nghttp2_session_del (session_);
505505}
506506
@@ -653,6 +653,8 @@ inline void Http2Session::AddStream(Http2Stream* stream) {
653653
654654
655655inline void Http2Session::RemoveStream (Http2Stream* stream) {
656+ if (streams_.empty () || stream == nullptr )
657+ return ; // Nothing to remove, item was never added?
656658 streams_.erase (stream->id ());
657659 DecrementCurrentSessionMemory (stream->self_size ());
658660}
Original file line number Diff line number Diff line change @@ -651,8 +651,8 @@ class Http2Stream : public AsyncWrap,
651651 Statistics statistics_ = {};
652652
653653 private:
654- Http2Session* session_; // The Parent HTTP/2 Session
655- int32_t id_; // The Stream Identifier
654+ Http2Session* session_ = nullptr ; // The Parent HTTP/2 Session
655+ int32_t id_ = 0 ; // The Stream Identifier
656656 int32_t code_ = NGHTTP2_NO_ERROR; // The RST_STREAM code (if any)
657657 int flags_ = NGHTTP2_STREAM_FLAG_NONE; // Internal state flags
658658
You can’t perform that action at this time.
0 commit comments