From 68c7bf3b55ca132143686ab433659c3b828760aa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 4 May 2021 20:42:25 +0300 Subject: attempt to fix some problems on exit --- protocols/EmLanProto/src/lan.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'protocols/EmLanProto') diff --git a/protocols/EmLanProto/src/lan.cpp b/protocols/EmLanProto/src/lan.cpp index 157470f2b0..deff7edd18 100644 --- a/protocols/EmLanProto/src/lan.cpp +++ b/protocols/EmLanProto/src/lan.cpp @@ -146,7 +146,7 @@ void CLan::StartListen() return; } - m_hListenThread = mir_forkthread(ListenProc, this); + mir_forkthread(ListenProc, this); m_hAcceptTCPThread = mir_forkthread(AcceptTCPProc, this); if (m_hListenThread == nullptr || m_hAcceptTCPThread == nullptr) { m_mode = LM_ON; @@ -176,6 +176,8 @@ void __cdecl CLan::ListenProc(void *lpParameter) void CLan::Listen() { + MThreadHandle threadLock(m_hListenThread); + if (m_mode == LM_LISTEN) { char buf[65536]; while (true) { -- cgit v1.2.3