Skip to content

Commit 8c363cd

Browse files
bnoordhuisaddaleax
authored andcommitted
src: don't touch js object in Http2Session dtor
Don't try to update the internal field pointer of the JS object in the destructor. The garbage collector invokes the destructor when the object is collected and is not necessarily in a valid state anymore. PR-URL: nodejs#18656 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 3de8e57 commit 8c363cd

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

src/node_http2.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,6 @@ Http2Session::Http2Session(Environment* env,
531531

532532
Http2Session::~Http2Session() {
533533
CHECK_EQ(flags_ & SESSION_STATE_HAS_SCOPE, 0);
534-
if (!object().IsEmpty())
535-
ClearWrap(object());
536534
DEBUG_HTTP2SESSION(this, "freeing nghttp2 session");
537535
nghttp2_session_del(session_);
538536
}

0 commit comments

Comments
 (0)