diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 8e70b88d31e..c65492cf315 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -79,6 +79,7 @@ TLSCallbacks::TLSCallbacks(Environment* env, cycle_depth_(0), eof_(false) { node::Wrap(object(), this); + MakeWeak(this); // Initialize queue for clearIn writes QUEUE_INIT(&write_item_queue_); diff --git a/src/tls_wrap.h b/src/tls_wrap.h index 13a53bfb307..34ae3ccbf65 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -46,6 +46,8 @@ class TLSCallbacks : public crypto::SSLWrap, public StreamWrapCallbacks, public AsyncWrap { public: + ~TLSCallbacks(); + static void Initialize(v8::Handle target, v8::Handle unused, v8::Handle context); @@ -94,7 +96,6 @@ class TLSCallbacks : public crypto::SSLWrap, Kind kind, v8::Handle sc, StreamWrapCallbacks* old); - ~TLSCallbacks(); static void SSLInfoCallback(const SSL* ssl_, int where, int ret); void InitSSL();