From 420d56c2ea63fd459501def38ea4fcb9d7d991e9 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 21 Feb 2018 15:24:18 +0100 Subject: [PATCH] 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. Backport-PR-URL: https://github.com/nodejs/node/pull/19185 PR-URL: https://github.com/nodejs/node/pull/18656 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Joyee Cheung --- src/node_http2.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/node_http2.cc b/src/node_http2.cc index ed6bdec7bb896c..f1454aa11e58e9 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -531,8 +531,6 @@ Http2Session::Http2Session(Environment* env, Http2Session::~Http2Session() { CHECK_EQ(flags_ & SESSION_STATE_HAS_SCOPE, 0); - if (!object().IsEmpty()) - ClearWrap(object()); DEBUG_HTTP2SESSION(this, "freeing nghttp2 session"); nghttp2_session_del(session_); }