We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79c1ba1 commit a9e9b9aCopy full SHA for a9e9b9a
src/tls_wrap.cc
@@ -86,12 +86,6 @@ TLSWrap::~TLSWrap() {
86
sni_context_.Reset();
87
#endif // SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
88
89
- // Move all writes to pending
90
- MakePending();
91
-
92
- // And destroy
93
- InvokeQueued(UV_ECANCELED);
94
95
ClearError();
96
}
97
@@ -763,7 +757,16 @@ void TLSWrap::EnableSessionCallbacks(
763
757
764
758
void TLSWrap::DestroySSL(const FunctionCallbackInfo<Value>& args) {
765
759
TLSWrap* wrap = Unwrap<TLSWrap>(args.Holder());
760
+
761
+ // Move all writes to pending
762
+ wrap->MakePending();
+ // And destroy
+ wrap->InvokeQueued(UV_ECANCELED);
766
767
+ // Destroy the SSL structure and friends
768
wrap->SSLWrap<TLSWrap>::DestroySSL();
769
770
delete wrap->clear_in_;
771
wrap->clear_in_ = nullptr;
772
0 commit comments