Skip to content

Commit 59d9734

Browse files
committedJun 4, 2015
tls_wrap: invoke queued callbacks in DestroySSL
PR-URL: #1702 Reviewed-By: Trevor Norris <[email protected]>
1 parent 75930bb commit 59d9734

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed
 

‎src/tls_wrap.cc

+9-6
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ TLSWrap::~TLSWrap() {
8686
sni_context_.Reset();
8787
#endif // SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
8888

89-
// Move all writes to pending
90-
MakePending();
91-
92-
// And destroy
93-
InvokeQueued(UV_ECANCELED);
94-
9589
ClearError();
9690
}
9791

@@ -770,7 +764,16 @@ void TLSWrap::EnableSessionCallbacks(
770764

771765
void TLSWrap::DestroySSL(const FunctionCallbackInfo<Value>& args) {
772766
TLSWrap* wrap = Unwrap<TLSWrap>(args.Holder());
767+
768+
// Move all writes to pending
769+
wrap->MakePending();
770+
771+
// And destroy
772+
wrap->InvokeQueued(UV_ECANCELED);
773+
774+
// Destroy the SSL structure and friends
773775
wrap->SSLWrap<TLSWrap>::DestroySSL();
776+
774777
delete wrap->clear_in_;
775778
wrap->clear_in_ = nullptr;
776779
}

0 commit comments

Comments
 (0)