GeezerVison is showing github.com — tls_wrap: invoke queued callbacks in DestroySSL · nodejs/node@59d9734
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/tls_wrap.cc +9-6Lines changed: 9 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -86,12 +86,6 @@ TLSWrap::~TLSWrap() { |
86 | 86 | sni_context_.Reset(); |
87 | 87 | #endif // SSL_CTRL_SET_TLSEXT_SERVERNAME_CB |
88 | 88 |
|
89 | | - // Move all writes to pending |
90 | | - MakePending(); |
91 | | - |
92 | | - // And destroy |
93 | | - InvokeQueued(UV_ECANCELED); |
94 | | - |
95 | 89 | ClearError(); |
96 | 90 | } |
97 | 91 |
|
@@ -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(); |
| 770 | + |
| 771 | + // And destroy |
| 772 | + wrap->InvokeQueued(UV_ECANCELED); |
| 773 | + |
| 774 | + // Destroy the SSL structure and friends |
773 | 775 | wrap->SSLWrap<TLSWrap>::DestroySSL(); |
| 776 | + |
774 | 777 | delete wrap->clear_in_; |
775 | 778 | wrap->clear_in_ = nullptr; |
776 | 779 | } |
|