diff --git a/src/js_stream.cc b/src/js_stream.cc index 21f5ce07ac08b3..7fcdfd9a94d9fd 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -26,6 +26,7 @@ JSStream::JSStream(Environment* env, Handle obj, AsyncWrap* parent) : StreamBase(env), AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent) { node::Wrap(obj, this); + MakeWeak(this); } diff --git a/src/js_stream.h b/src/js_stream.h index 8e2ff13258b219..6bc763b36e2bd1 100644 --- a/src/js_stream.h +++ b/src/js_stream.h @@ -14,6 +14,8 @@ class JSStream : public StreamBase, public AsyncWrap { v8::Handle unused, v8::Handle context); + ~JSStream(); + void* Cast() override; bool IsAlive() override; bool IsClosing() override; @@ -28,7 +30,6 @@ class JSStream : public StreamBase, public AsyncWrap { protected: JSStream(Environment* env, v8::Handle obj, AsyncWrap* parent); - ~JSStream(); AsyncWrap* GetAsyncWrap() override;