From 592fb9ab1e353d041af9b646a38985dc4b515715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Ma=C5=82ecki?= Date: Tue, 21 Jan 2020 16:49:12 +0100 Subject: [PATCH] Bugfix: close the crypto under correct conditions --- srtcore/core.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/srtcore/core.cpp b/srtcore/core.cpp index 5b8358737..5a38ecafc 100644 --- a/srtcore/core.cpp +++ b/srtcore/core.cpp @@ -5395,8 +5395,6 @@ bool CUDT::close() sendCtrl(UMSG_SHUTDOWN); } - m_pCryptoControl->close(); - // Store current connection information. CInfoBlock ib; ib.m_iIPversion = m_PeerAddr.family(); @@ -5408,6 +5406,9 @@ bool CUDT::close() m_bConnected = false; } + if (m_pCryptoControl) + m_pCryptoControl->close(); + if (m_bTsbPd && !pthread_equal(m_RcvTsbPdThread, pthread_t())) { HLOGC(mglog.Debug, log << "CLOSING, joining TSBPD thread...");