We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75930bb commit 59d9734Copy full SHA for 59d9734
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
@@ -770,7 +764,16 @@ void TLSWrap::EnableSessionCallbacks(
770
764
771
765
void TLSWrap::DestroySSL(const FunctionCallbackInfo<Value>& args) {
772
766
TLSWrap* wrap = Unwrap<TLSWrap>(args.Holder());
767
+
768
+ // Move all writes to pending
769
+ wrap->MakePending();
+ // And destroy
+ wrap->InvokeQueued(UV_ECANCELED);
773
774
+ // Destroy the SSL structure and friends
775
wrap->SSLWrap<TLSWrap>::DestroySSL();
776
777
delete wrap->clear_in_;
778
wrap->clear_in_ = nullptr;
779
0 commit comments